As part of a project i want to display the speed of a small wheel on a 7 segment display. I am using a hall effect sensor to pick up the pulses of the rotation. I am not sure how to write a programe on C to calculate the RPM from this....
I have a project that I am working on and I have gotten stuck. I am getting a couple errors and would like to see how I can complete the program. Not very long of a program at that. My instructions are:
Write a program to calculate averages. Create a method named ReadData that will load a two dimensional array, named scoresArray, with the following data from a file:
Create a method named DisplayAverages that will display the emplyee number (number starting 1324, 4356 etc) and the average of the three test grades. DisplayAverages will have one argument, the scoresArray. Your output should closely resemble the following.
Round averages to one decimal place. Passing arguments is important for this program. No global variables are allowed, except for the streamReader and the streamWriter. The scoresArray must be declared in Main and passed as an argument to the methods ReadData and DisplayAverages.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using LibUtil; using System.IO; using System.Text.RegularExpressions;
[Code] ....
When I run the following just to see where I am getting I get the following error:
UsersJoeDocumentsVisual Studio 2013ProjectsCIS110Program12Program12Prog ram12Dat.txt was opened Unhandled Exception: System.IndexOutOfRangeException: Index was outside the boun ds of the array. at Program12.Program.ReadData(Double[,] scoresArray) in c:UsersJoeDocument sVisual Studio 2013ProjectsCIS110Program12Program12Program.cs:line 66 at Program12.Program.Main() in c:UsersJoeDocumentsVisual Studio 2013Proj ectsCIS110Program12Program12Program.cs:line 24 Press any key to continue . . .
What am I missing here? I believe I have passed the arguments properly, but I am unable to declair the array within the bounds of the array?
SLD_ttf lib and I have been following the Lazy Foo' tuts on it but the text is not appearing. I have found out that it is not loading the font as I have added in the code saying if it has failed.
Code:
font = TTF_OpenFont( "lazy.ttf", 28 ); if( font == NULL ) { return false; }
i have saved this font in the project (project name/project name/lazy.ttf).
I am trying to display images on top of my Background image gui, so like buttons an stuff but the problem is that there not showing ontop. I can only get one of them to show
// includes #include <windows.h> #include <stdio.h> #include "res.h"
I've run across this issue before, but for the like of me, I can't figure out what keeps causing it. The problem compiles and runs as expected; however in the salaried object (Employee #1 in main.cpp) the console displays the number of vacation days as -858993460 instead of the value entered.
The parent Employee class is abstract with calculatePay() and displayEmployee() being pure virtualls and with a Benefits, Salaried, and Hourly class derived from it.
The Salaried displayEmployee() and the portion of the Main.cpp that contains the salaried object follows. What causing this?
I just checking but confused with float. in that code same size int, and same type double are working but float showing nothing in printf..why?? i'm using GCC compiler int 32bit win7 os
My question is why my on my code there is 10 zip code and i want to show the first digit, the problem is the first digit does not match the zip code for example the zip code is 45805 it should be '5' however, my code shows other number!
i have been making code of a chessgame and now sddenly computer freezed and now there's not code in .cpp file! Although my .cpp file shows size of 16kb but when i open it . there's nothing except bank file
I'm programming tic tac toe but the board is not showing numbers, and it is simply stating the winner without any input: (the win conditions are not complete, but it shouldn't matter).
#include <iostream> #include<string> using namespace std; //Write a two-player tic-tac-toe game; use enums when possible to represent the values of the board
I'm receiving an error that an array has not been initialized but I'm not quite sure why. Also, I realize a list may be better in this scenario but I would still like to know what I'm doing wrong.
Warning in the IDE
Warning3Field 'Routines.SvrMain.Servers' is never assigned to, and will always have its default value nullD:Google DriveCodingC# ProjectsNONameWindowsFormsApplication1WindowsFormsApplication1Routines.cs26638WindowsFormsApplication1
Error that pops on line Servers[Index].Address = Parser.ReturnAddress(); //returns an IPAddress
Object reference not set to an instance error
ServerDetails Class public class ServerDetails { public IPAddress Address; { get; set; } public int Port { get; set; } }
I wanna know why the program doesnt show "Invalid Letter Entered" when i enter any letter other than A S D or M
//Processing the data if (letter== 'A'||'S'||'M'||'D')// checking Add, subtract, multiply or divide { if (letter== 'A')//Adding the integers cout<<"Adding two integers = "<<first + second<<endl; else if (letter== 'S')//Subtracting the integers {
Same solution that I was having compiler errors on yesterday. We're working with inheritance and the program is supposed to be to create and display information for default Employee objects, Hourly Employee objects and Salaried Employee objects. Everything compiles as is, but I'm running into two issues that I can't figure out.
1) In both the hourly and salaried objects, the wage, hours, and management level attributes all displaying their default values. I'm almost positive that this has something to do with the str to int and str to double conversions that I'm using (currently have atoi and atof in the file, but I've also tried stringstream, but still had to same problem). Any thoughts as to what I'm missing?
2) the assignment calls for the Benefit benefit member in Employee.h to be protected. However this makes the member unaccessible when I try to use it in the EmployeeMain.cpp in order to set the input for the Benefit class members. I had to make the Benefit benefit member public again to get it to compile. How would I set the input for the Benefit class members while the Benefit benefit member is protected?
I'm writing a program that shows check fees for different amounts of checks. My other fees are showing up right but the .10 cents is not. It's showing up as .08 cents per check when I run the program.
Oh yeah the + 10 is for a $10 fee
Code: else if (checks < 20 || checks >= 0) { fee = .10 * checks + 10; cout<< "Bank service charge for the month is $ " << setprecision(4) << endl; }
When i am entering single character instead of 'miz' then it is working great. But when i am using multi character like 'miz' it is showing error output. i did this program with c++ it is working but not working in c.When i am running this program it is showing {warning] multi character constant.
Code:
#include<stdio.h> #include<string.h> main() { char a; printf("Please Enter your First Name: "); scanf("%s",&a);
So I have a small game I'm making using OOP principles, I know it's a little bit of overkill but it's just for educational purposes. I have a sprite character that can be moved around with no problems, but I made a sword for him as a separate sprite that doesn't follow him. The sword sprite is supposed to cover his arm and his body as it swings, but it just stays in the upper left corner.
I messed around with the initialization of the sword in the main.cpp and I changed in sword.cpp and sword.h and it still is showing up in the same place. I even looked at the GetX() and GetY() statements I made and they seemed to work fine and when I debugged it, the variable values showed up correctly, but the sword doesn't move.
I am new to using classes, and am running into an issue already. I have created the class, and am in the process of adding data to the classes. I have added one piece of data, and now just want to see if I can get it to show in another function, but I am not sure why it is not showing. What about getting the data to show. Then, I will be able to work on adding the rest of the info.
#include <iostream> #include <cctype> #include <stdio.h> #include <stdlib.h> using namespace std; //******************************Bill Class************************** class bill {
[Code] ....
FYI - This is only the relevant code. There is more for this that I have not added.
Error #1: error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
Error #2: error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
#include<iostream> #include<string> using namespace std; //Constructors for class. class CollegeCourse { private: int courseNum;
[Code] ....
When I debug my program, the objects is showing up on one line bunched up together. I also want to be able to enter data after each object of the classes.
The details of my project is as follows:
Inheritance in C++ means you can create classes that derive their attributes from existing Classes, in other words, a newly created class can absorb all the data fields and functions of a class already being used. When one class is derived from another, the original class is the parent class, base class, or sometimes called the parent class. The derived class is a child class, or sometimes called the subclass.
Inheritance is central to Object Oriented Programming. The advantages of inheritance are it allows the code to be reused as many times as needed. Inheritance also saves time and effort as the main code need not be written again.
Create a C++ program using Visual program that could be used by a college to track its courses. In this program, create a CollegeCourse class includes fields representing department, course number, credit hours, and tuition. Create a child (sub class) class named LabCourse, that inherits all fields from the CollegeCourse class, includes one more field that holds a lab fee charged in addition to the tuition. Create appropriate functions for these classes, and write a main() function that instantiates and uses objects of each class.
sometimes only the first web page is opened, but sometimes all of them. What I should do so that all the web pages opened with OpenURL-function are always opened? Also, better ways to open web pages are very welcome. I use Visual Studio 2008 Express and Visual Studio 2013 Express.
Trying to show the Row totals and the Column totals.
#include <stdio.h> int main() { /* start of main */ #define NUMROWS 5 /* establishes NUMROWS as 5 */ #define NUMCOLS 5 /* establishes NUMCOLS as 5 */ int val[NUMROWS][NUMCOLS] = { {23,06,85,22,01}, /* declares array val to have 5 rows and 5 columns */ {07,33,62,17,04},
[Code] ....
I receive this message after building:
1>------ Build started: Project: WA 4 A 1 Christopher Caron, Configuration: Debug Win32 ------ 1> WA 4 A 1 Christopher Caron.cpp 1>c:userschrisdocumentsvisual studio 2010projectswa 4 christopher caronwa 4 christopher caronwa 4 a 1 christopher caron.cpp(21): error C2106: '=' : left operand must be l-value
I got this code from a wiki that taught me how to make C code that plays audio, and with a few changes I was able to get it to take a command-line argument as the music file name. Here it is
The only problem is, even though I guess it needs to create a window to work with SDL, is there any way you could hide it or something so the user can't see it? I don't really want to see it ( I'm planning on running it from Batch files or C applications as an easy way to play an audio file once ), because if I did, I might as well just use a default audio player instead.
my motive is whenever any running process closes/quits whether it be console or window based on windows it notify(s) me or user that some .exe has been closed.
I'm having problems with the docking system I implemented into my project. This is my own project I have been working on for a while. The docking system I'm using is the WeifenLuo.WinFormsUI.Docking. When ever I go to drag the Dock Content to another location the UI doesn't show up and the panel doesn't drag like its supposed to. The program worked just fine and this problem went unnoticed for a while. I cannot dick the panel in any other place. All I can do it double click to return it back to its place.