C++ Help!

solidcrowd
10+ year member

CarAudio.com Elite
I have no idea what to do!!! //content.invisioncic.com/y282845/emoticons/confused.gif.e820e0216602db4765798ac39d28caa9.gif, Due in the morning. If anyone could help out or just do part of the problems, so I don't fail the whole thing, I would greatly appreciate it.

(1a) Use a for loop to add the positive odd numbers less than 100. Output the total.

(1b) Use a while loop to add the positive even numbers less than 50. Output the total

(1c) Use a nested loop structure to compute and print the powers from 1 to 10 of the numbers 2, 3, 4, 5, 6, 7.

(1d) Assume you have the following variable char accountType;

which can have an upper or lower case letter ( c or C for checking account) ( s or S for savings account)

( l or L for loan account).

Write a switch statement that outputs an appropriate message to show the value of the current account type, and prints a reasonable message if the account type is not one of the three types given in this problem.

(2) Write a program in C++ that does the following using file input and common output

• read in the number of students in the class

• read in the number of test scores that each student should have completed

• repeat for each student

read the specified number of student scores

compute the average of a student’s scores

determine the letter grade earned by a student using the following criteria

A average between 90 to 100

B average greater than or equal to 80 but less than 90

C average greater than or equal to 70 but less than 80

U unsatisfactory if less than 70

output a student’s scores, average and letter grade appropriately labeled

Sample output expected from the program:

Student 1: Average = 95.2 Grade = A

Student 2: Average = 88.3 Grade = B

Student 3: Average = 75.2 Grade = C

Student 4: Average = 55.2 Grade = U

// you can assume the correct header files are included

// assumption – valid and complete data is stored in a file called scores.txt

int numOfStudents; // identifies the number of student data lines in file

int numOfscores; // identifies the number of test scores for each student

ifstream inData;

inData.open(“scores.txt”);

inData >> numOfStudents;

inData >> numOfScores;

// remainder of the data in the file is the appropriate number of student scores

 
Here is the answer to 1c

#include

#include

using namespace std;

int main()

{

double x, y, z;

for(x=1;x

{

for(y=2; y

{

z = pow(y,x);

cout

}

}

system("pause");

return 0;

}

 
I have no idea what to do!!! //content.invisioncic.com/y282845/emoticons/confused.gif.e820e0216602db4765798ac39d28caa9.gif, Due in the morning. If anyone could help out or just do part of the problems, so I don't fail the whole thing, I would greatly appreciate it.



(1a) Use a for loop to add the positive odd numbers less than 100. Output the total.

(1b) Use a while loop to add the positive even numbers less than 50. Output the total

(1c) Use a nested loop structure to compute and print the powers from 1 to 10 of the numbers 2, 3, 4, 5, 6, 7.

(1d) Assume you have the following variable char accountType;

which can have an upper or lower case letter ( c or C for checking account) ( s or S for savings account)

( l or L for loan account).

Write a switch statement that outputs an appropriate message to show the value of the current account type, and prints a reasonable message if the account type is not one of the three types given in this problem.

(2) Write a program in C++ that does the following using file input and common output

• read in the number of students in the class

• read in the number of test scores that each student should have completed

• repeat for each student

read the specified number of student scores

compute the average of a student’s scores

determine the letter grade earned by a student using the following criteria

A average between 90 to 100

B average greater than or equal to 80 but less than 90

C average greater than or equal to 70 but less than 80

U unsatisfactory if less than 70

output a student’s scores, average and letter grade appropriately labeled

Sample output expected from the program:

Student 1: Average = 95.2 Grade = A

Student 2: Average = 88.3 Grade = B

Student 3: Average = 75.2 Grade = C

Student 4: Average = 55.2 Grade = U

// you can assume the correct header files are included

// assumption – valid and complete data is stored in a file called scores.txt

int numOfStudents; // identifies the number of student data lines in file

int numOfscores; // identifies the number of test scores for each student

ifstream inData;

inData.open(“scores.txt”);

inData >> numOfStudents;

inData >> numOfScores;

// remainder of the data in the file is the appropriate number of student scores
I've been in IT (that's Information Technology for most of you who don't have a clue what IT means) for 23+ years and have a Master's degree in CIS (that would be Computer Information Systems, again for most who only know acronyms that pertain to car audio or ****)...here's an idea for the OP. Use what little of a brain that you have and do the work yourself. Man, your generation is the biggest lazy POS's I have ever seen! By the way, that problem is S-I-M-P-L-E if you actually paid attention in class. And no, I'm not giving you the answer. Dumb ***. //content.invisioncic.com/y282845/emoticons/laugh.gif.48439b2acf2cfca21620f01e7f77d1e4.gif

 
Activity
No one is currently typing a reply...

About this thread

solidcrowd

10+ year member
CarAudio.com Elite
Thread starter
solidcrowd
Joined
Location
Buffalo, New York
Start date
Participants
Who Replied
Replies
7
Views
223
Last reply date
Last reply from
Synyster97XLT
IMG_20260515_202650612_HDR.jpg

sherbanater

    May 15, 2026
  • 0
  • 0
IMG_20260515_202732887_HDR.jpg

sherbanater

    May 15, 2026
  • 0
  • 0

New threads

Top