Here is the assignment... Write a program to generate a report based on input received from a text file. Suppose the input text file student_status.txt contains the student’s name (lastName, firstName middleName), id, number of credits earned as follows :
Doe, John K. 3460 25 Andrews, Susan S. 3987 72 Monroe, Marylin 2298 87 Gaston, Arthur C. 2894 110
Generate the output in the following format :
John K. Doe 3460 25 Freshman Susan S. Andrews 3987 40 Sophomore Marylin Monroe 2298 87 Junior Arthur C. Gaston 2894 110 Senior
The program must be written to use the enum class_level :
The function deriveClassLevel should derive the class_level of the student based on the number of credits earned.
The first namespace globalType tys should derive the class level based on a two year school policy. And the second namespace globalType fys should derive the class level based on a four year school policy.
Four Year School Policy: Freshman 0-29 creditsSophomore 30-59 credits Junior 60-89 creditsSenior 90 or more credits
Two Year School Policy: Freshman 0-29 creditsSophomore 30 or more credits
My main question is did I use the namespaces and enum correctly? And my second question is whats the best way to input the data from the text file? This is really where I get stuck.
Write a program to generate a report based on input received from a text file. Suppose the input text file student_status.txt contains the student’s name (lastName, firstName middleName), id, number of credits earned as follows :
Doe, John K. 3460 25 Andrews, Susan S. 3987 72 Monroe, Marylin 2298 87 Gaston, Arthur C. 2894 110
Generate the output in the following format :
John K. Doe 3460 25 Freshman Susan S. Andrews 3987 40 Sophomore Marylin Monroe 2298 87 Junior Arthur C. Gaston 2894 110 Senior
The program must be written to use the enum class_level :
The function deriveClassLevel should derive the class_level of the student based on the number of credits earned.
The first namespace globalType tys should derive the class level based on a two year school policy. The second namespace globalType fys should derive the class level based on a four year school policy.
So I basically did it in parts and got everything working and then had to make the namespace so I had this:
with this i keep getting an error saying tys::deriveClassLevel: must return a value and tys::fys::deriveClassLevel: must return a value. I have been messing around with this part and struggling I thought I used the namespace to run the if statements with the criteria for the years of school. Basically I have been stuck for awhile and trying to change things around but I cant seem to get it to work.
Write a program to generate a report based on input received from a text file. Suppose the input text file student_status.txt contains the student’s name (lastName, firstName middleName), id, number of credits earned as follows :
Doe, John K. 3460 25 Andrews, Susan S. 3987 72 Monroe, Marylin 2298 87 Gaston, Arthur C. 2894 110
Generate the output in the following format :
John K. Doe 3460 25 Freshman Susan S. Andrews 3987 40 Sophomore Marylin Monroe 2298 87 Junior Arthur C. Gaston 2894 110 Senior
The program must be written to use the enum class_level :
The function deriveClassLevel should derive the class_level of the student based on the number of credits earned.
The first namespace globalType tys should derive the class level based on a two year school policy. and the second namespace globalType fys should derive the class level based on a four year school policy.
Four Year School Policy: Freshman 0-29 creditsSophomore 30-59 credits Junior 60-89 creditsSenior 90 or more credits
Two Year School Policy: Freshman 0-29 creditsSophomore 30 or more credits
NOTE : use ignore() function with ifstream objects whenever you want to ignore the newline character.
For example : ifstream transferSchoolFile ; transferSchoolFile.open("student_status.txt", ios::in);
while( !transferSchoolFile.eof()) { getline(transferSchoolFile,name) ; transferSchoolFile >> id >> credits; transferSchoolFile.ignore(); //Used here to ignore the newline character. …. }
I did this in parts so I got it working with a four year criteria without the user defined name spaces.
include <iostream> #include <fstream> #include <string>
I know I have some stuff to mess around with but I am currently stuck with two errors, first -
Error1error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartupC:UsersstephenDocumentsVisual Studio 2013ProjectsinputConsoleApplication1MSVCRTD.lib(crtexe.obj)ConsoleApplication1
then -
Error2error LNK1120: 1 unresolved externalsC:UsersstephenDocumentsVisual Studio 2013ProjectsinputDebugConsoleApplication1.exeConsoleApplication1
Program Description: Write a program to generate a report based on input received from a text file. Suppose the input text file student_status.txt contains the student's name (lastName, firstName middleName), id, number of credits earned as follows :
Doe, John K. 3460 25 Andrews, Susan S. 3987 72 Monroe, Marylin 2298 87 Gaston, Arthur C. 2894 110
Generate the output in the following format :
John K. Doe 3460 25 Freshman Susan S. Andrews 3987 40 Sophomore Marylin Monroe 2298 87 Junior Arthur C. Gaston 2894 110 Senior
The program must be written to use the enum class_level :
The function deriveClassLevel should derive the class_level of the student based on the number of credits earned.
The first namespace globalType tys should derive the class level based on a two year school policy. and the second namespace globalType fys should derive the class level based on a four year school policy.
Four Year School Policy: Freshman 0-29 creditsSophomore 30-59 credits Junior 60-89 creditsSenior 90 or more credits
Two Year School Policy: Freshman 0-29 creditsSophomore 30 or more credits
NOTE : use ignore() function with ifstream objects whenever you want to ignore the newline character. For example :
I know I have some stuff to mess around with but I am currently stuck with two errors, first -
Error1error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartupC:UsersstephenDocumentsVisual Studio 2013ProjectsinputConsoleApplication1MSVCRTD.lib(crtexe.obj)ConsoleApplication1
then -
Error2error LNK1120: 1 unresolved externalsC:UsersstephenDocumentsVisual Studio 2013ProjectsinputDebugConsoleApplication1.exeConsoleApplication1
I want to get or view the SIM card number from the dongle (the dongle will b already connected to the computer where the SIM card will be inserted into it) but the coding should be done by C programming / Language.
I'm writing a program that writes to a report in a text file. It uses a struct but with no array. How can I write this so that the report comes out as it should because as of now after i removed the brackets from record which is the variable of the struct my report isn't printing right.
Consider a program that simulates a card game, with multiple player hands and a deck to draw from. Each hand can use an array to represent the cards it contains; sometimes it is useful to also declare an additional variable for each hand (or deck) indicating exactly how many cards are present.
1) Describe a simple function that would manipulate both the array representing a hand and the number indicating the size of the hand.
2) Describe a simple function that might be able to manipulate the array without referring to the hand size variable at all.
3) Generally, if the array was passed as a parameter to a function, how often would the hand size be included as a parameter?
so I'm creating a program that generates random sentences with structs..I'm trying to use structs and and create 4 different groupings article, noun, verb, and preposition. Then I'm trying to use "r = rand() % ;" to randomly pick one one word from each group to make a sentence. this is what i have
Code:
typedef enum article { the = 1, a, one, some, any } article; typedef enum noun { boy = 1, girl, dog, town, car }
Problem: Write a program to generate a calendar for a year. The program should accept the year and the day of the week for January 1 of that year (0 = Sunday, 1 = Monday, etc.). The calendar should be printed in the following form:
I have wrote code that has three functions, one to print the month, one to print the days in month, and one to find if it is a leap year or not. I have gotten up to the point where I can print the 12 months with a for loop, but how to print out the days in the format above.
This is my code.
#include <iostream> using namespace std; void printOneMonth(int month, int& dow, int year); void daysInMonth(int month, int year, int& dim); bool isLeapYear(int year); int main(){ int year=0, dow, count;
i wanna no if i can make the program generate a different number everytime you guess the number right and want to play again. it always generates the same number
I am a C++ beginner with no programming background. I need to write a lottery program that generate 5 non-duplicate numbers between 1 and 20. Here is my code and it just wont work.
#include <iostream> #include <stdlib.h> #include <time.h> #include <iomanip> using namespace std; int main() { srand(time(NULL)); int lottery[5] = { 0, 0, 0, 0, 0 }, count = 0, rand_lottery;
My program asks me to write a C++ program that generates a random number between 1-100, and lets the user guess the number until he/she guesses correctly.
I have every thing done but my loop will not end. I know I have to "update" the loop to end it but I don't know what that means.
#include <iostream> #include <iomanip> #include <ctime> using namespace std;
int main() { srand(time(NULL)); //the function that generates random numbers
I need to write a lottery program that generate 5 non duplicate number between 1-20. Below is my code and it said my [i] is undefined and it is an undeclare identifier.
#include <iostream> #include <stdlib.h> #include <time.h> #include <iomanip> using namespace std; int main(){ srand(time(NULL));
Write a program that will generate, but not display, a three-digit "target" number that has three distinct digits. (Hint: use random number generator.) Then, input a maximum of ten user guesses and for each guess, output the number of hits and matches in the guess. Stop when the user guesses the number or runs out of guesses. For example, if the target is 427, the guess 207 has one hit (7) and one match (2).
I have been writing a program to generate pairs of RSA keys using small prime numbers. I have been using mpz_invert() to get a value for d for the private key. On small prime numbers it calculates the correct value, but on larger primes it calculates incorrect values.
I'm assuming there must be an upper limit to the values the mpz_invert() function can handle? If so, what is this limit to avoid erroneous values?
Okay, so my assignment for my C class is to generate a program that will allow the user to enter data for a stock and calculate the amount of stocks that ended up being positive, negative, and neutral.I tried to do this using one stock, here is my code;
i have project (person ID cared) and fortunately i could finish it in programming,,,,, but the thing that i don't know what to do about it is how to print this data? can i use reportviewer ?
I'm trying to write a table (2D array) with a string of random chars in one row for the student names, six other rows for the project numbers and random numbers for the grades.Then calculate the averages of grades per student and per project, add them as the last row and the last column. And write a menu of 4 options:
1- sort per student names (alphabetical order) 2- sort per student grades (in increasing order) 3- sort per project grades ( in increasing order) 4- exit
The program must continue execution after displaying any report, need to use an infinite loop, it exits only if the chosen 'exit'.
It cannot loop back to the top coding, cause what i want is the code can loop back to the 1st cout question, and it will asking over and over again, and how to declare a function for the summary report?