Menu
Forum
General Car Audio
Subwoofers
Speakers
Amplifiers
Head Units
Car Audio Build Logs
Wiring, Electrical and Installation
Enclosure Design & Construction
Car Audio Classifieds
Home Audio
Off-topic Discussion
The Lounge
What's new
Search forums
Gallery
New media
New comments
Search media
Members
Registered members
Current visitors
Classifieds Member Feedback
SHOP
Shop Head Units
Shop Amplifiers
Shop Speakers
Shop Subwoofers
Shop eBay Car Audio
Log in / Register
Forum
Search
Search titles and first posts only
Search titles only
Search titles and first posts only
Search titles only
Log in / Join
What’s new
Search
Search titles and first posts only
Search titles only
Search titles and first posts only
Search titles only
General Car Audio
Subwoofers
Speakers
Amplifiers
Head Units
Car Audio Build Logs
Wiring, Electrical and Installation
Enclosure Design & Construction
Car Audio Classifieds
Home Audio
Off-topic Discussion
The Lounge
What's new
Search forums
Menu
Reply to thread
Forum
Off-topic Discussion
The Lounge
C++ Help!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="solidcrowd" data-source="post: 6457204" data-attributes="member: 565671"><p>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.</p><p></p><p>(1a) Use a for loop to add the positive odd numbers less than 100. Output the total.</p><p></p><p>(1b) Use a while loop to add the positive even numbers less than 50. Output the total</p><p></p><p>(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.</p><p></p><p>(1d) Assume you have the following variable char accountType;</p><p></p><p>which can have an upper or lower case letter ( c or C for checking account) ( s or S for savings account)</p><p></p><p>( l or L for loan account).</p><p></p><p>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.</p><p></p><p>(2) Write a program in C++ that does the following using file input and common output</p><p></p><p>• read in the number of students in the class</p><p></p><p>• read in the number of test scores that each student should have completed</p><p></p><p>• repeat for each student</p><p></p><p>read the specified number of student scores</p><p></p><p>compute the average of a student’s scores</p><p></p><p>determine the letter grade earned by a student using the following criteria</p><p></p><p>A average between 90 to 100</p><p></p><p>B average greater than or equal to 80 but less than 90</p><p></p><p>C average greater than or equal to 70 but less than 80</p><p></p><p>U unsatisfactory if less than 70</p><p></p><p>output a student’s scores, average and letter grade appropriately labeled</p><p></p><p>Sample output expected from the program:</p><p></p><p>Student 1: Average = 95.2 Grade = A</p><p></p><p>Student 2: Average = 88.3 Grade = B</p><p></p><p>Student 3: Average = 75.2 Grade = C</p><p></p><p>Student 4: Average = 55.2 Grade = U</p><p></p><p>// you can assume the correct header files are included</p><p></p><p>// assumption – valid and complete data is stored in a file called scores.txt</p><p></p><p>int numOfStudents; // identifies the number of student data lines in file</p><p></p><p>int numOfscores; // identifies the number of test scores for each student</p><p></p><p>ifstream inData;</p><p></p><p>inData.open(“scores.txt”);</p><p></p><p>inData &gt;&gt; numOfStudents;</p><p></p><p>inData &gt;&gt; numOfScores;</p><p></p><p>// remainder of the data in the file is the appropriate number of student scores</p></blockquote><p></p>
[QUOTE="solidcrowd, post: 6457204, member: 565671"] I have no idea what to do!!! [IMG]//content.invisioncic.com/y282845/emoticons/confused.gif.e820e0216602db4765798ac39d28caa9.gif[/IMG], 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 [/QUOTE]
Insert quotes…
Verification
Post reply
Forum
Off-topic Discussion
The Lounge
C++ Help!
Top
Menu
What's new
Forum list