![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Programming A discussion forum for programs and programming used in tech-related businesses. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Oct 2009
Posts: 1
OS: Windows Vista
|
C++ Exercise
Task for Exercise 1
Suppose that a float variable called score contains the overall points earned for this course. The following set of cascaded if-then-else pseudocode statements determines your final grade. If (score >= 85) then Set grade = ‘A’ Else If (score >= 75) then Set grade = ‘B’ Else If (score >= 65) then Set grade = ‘C’ Else If (score >= 55) then Set grade = ‘D’ Else Set grade = ‘F’ End if // score >= 55 End if // score >= 65 End if // score >= 75 End if // score >= 85 Your assignment is to convert this pseudocode into a C++ program. Use the following template for your program and remember to maintain all the blank lines, spaces, and general alignment. Then replace the areas that have been highlighted in yellow with your code. Do not change any of the other code. Code Template for Exercise 1 /****************************************************/ /* File: name of your file with the source code */ /* */ /* Created by: give your name */ /* Date: give the date */ /* */ /* Program to determine course grade */ /* */ /* Inputs: (keyboard) */ /* 1. Float - weighted total points (<= 100) */ /* */ /* Output: */ /* letter grade using pseudocode grading policy */ /* */ /* Algorithm: Comparisons using if-then-else */ /* */ /****************************************************/ #include <iostream> using namespace std ; int main() { Declare score and grade appropriately as variables. // read in total score cout << endl ; cout << "Enter total score (float, must be <= 100) : " ; cin >> score ; Write C++ if-then-else statements to determine course grade, using the grading policy stated in the pseudocode. // display the result cout << endl ; cout << "Your grade for CMIS 102 is: " << grade << endl ; return (0); // terminate with success } Test Plan for Exercise 1 Test your code with the following numbers: 85.0, 65.0001, 54.99999, –33.3, 100, 90, 150 |
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) | |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,879
OS: Vista, various linux distros
|
Re: C++ Exercise
Hey, please read the forum rules:
Quote:
Cheers, Jamey |
|
|
|
|
|
#3 (permalink) |
|
Manager
Join Date: Sep 2004
Location: Colorado
Posts: 986
OS: Mac OS 9.1, Mac OS X 10.5.8, WinXP Pro, FreeBSD 6.0, Gentoo Linux
|
Re: C++ Exercise
As jamiemac2005 stated, we have specific rules about helping with homework. If you do not understand the assignment, I suggest you schedule a meeting with your instructor/TA for the course or attend office hours.
Thread closed. Please review the forum rules.
__________________
![]() Has it been a few days since I replied to your thread? Don't panic! I'm a busy college student and may forget a post if I'm extra busy (or it might just take me a while to be able to do a decent reply). If you still need help and are awaiting my reply after a few days, PM me about it. When posting what errors you get, please give the full message. It makes helping you much easier. Last edited by shuuhen; 10-17-2009 at 03:07 PM. |
|
|
![]() |
| Thread Tools | |
|
|