Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Computer Science - Intro to C++ Problem

You be prompting a student for grades and credits for courses taken. From that, you will calculate a GPA.

This site: http://www.back2college.com/gpa.htm shows you how to calculate a GPA.

Keep prompting the student if they want to add more courses.

IMPORTANT NOTES!

  • The course name is prompted for, but nothing is done with it.
  • We are just using the grades A, B, C, D, and F so you won't have to do so much typing!
  • You will need to use the "set precision" command Set it to "fixed" and "2".
  • You will need to use the "cin.ignore()" function as discussed earlier in the course.

This is what I have thus far:

#include

#include

using namespace std;

string course;

int credits;

string grade;

string answer;  

int main() {

  cout << "Enter a course name: ";

  getline(cin,course);

  cout << course;

  cout << endl;

   cout << "Enter number of credits: ";

  cin >> credits;

  cout << credits;

  cout << endl;

  cout << "Enter you grade (A, B, C, D, F): ";

  cin >> grade;

  cout << grade;

  cout << endl;

  cout << "Continue ('Yes' or 'No')? ";

  cin >> answer;

  cout << answer;

  cout << endl;

  return 0;

}

Do I need a while loop to ask questions, and I am assuming a:

if(grade == "A"){

gradePoint = credit * 4;

}

What about the "set precision" to a fixed 2 value and "cin.ignore()" in the program?

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92759873
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Salariestask compute the weekly pay for each employee at

Salaries Task: Compute the weekly pay for each employee at the Wahoo Widget Company. For each employee, you will calculate the base pay according to the appropriate salary category, and then subtract taxes and deductions ...

A study investigated whether time perception an indication

A study investigated whether time perception, an indication of a person's ability to concentrate, is impaired during nicotine withdrawal. Smokers were randomly selected and asked to estimate how much time has passed duri ...

Requirementsin this assignment you will implement a

Requirements In this assignment, you will implement a lightweight version of an ArrayList class. You may refer to the Java code and documentation for guidance, but you must write the implementation yourself. Additionally ...

With respect to bus request interruptswhat must be allowed

With respect to bus request interrupts: What must be allowed to complete before the interrupts is serviced? What resources (CPU, buses, memory, etc..) is the ISR expected to use? What is the ISR typically expected to do? ...

Discussion question a sketch the storyboard for the simple

Discussion Question : a) Sketch the storyboard for the simple student information application. Recall that there are 6 files (scripts): connectcode.php, createtables.php, enterstudent.html, enterstudent.php, showstudents ...

Supposed datagrams are limited to 1600 bytes including

Supposed datagrams are limited to 1600 bytes (including header, with header size = 40) between host A and destination host B. Assuming a 20-byte IP header; further assume that the data is carried in TCP segments, with ea ...

Is smartart graphic and table slide important for

Is Smartart graphic and Table slide important for PowerPoint Presentation? How would it benefit?

Can someone show me a working implementation in c source

Can someone show me a working implementation, in C source code, of a Linux shell that will use shared memory for command execution using pipes that read data from the shared memory region? For example: you type ls -1 | w ...

Systems analysis chapter 6 please answer the four questions

Systems analysis chapter 6: Please answer the four questions at the tasks section Campus Bikes is a popular bicycle shop located near a major university. The business has grown and the owner, Mark Turner, wants to instal ...

What conclusions can you draw about the heat of solution

What conclusions can you draw about the heat of solution for the three salts tested and the effect on the temperature changes when the salts were dissolved in water? Your answer should include the words Endothermic and E ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As