Computer science-intro to c problem

Assignment Help Basic Computer Science
Reference no: EM131921210

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: https://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 <iostream>

#include <string>

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?

Reference no: EM131921210

Questions Cloud

Compute the amount of pension expense : Amortization of unrecognized prior service cost for the year 270,000, Compute the amount of pension expense for 2010. Be sure to show your work
What fraction of ownership in your idea do you need to sell : You have an idea that requires an investment of $60 today, What fraction of ownership in your idea (what percentage of E) do you need to sell?
Discuss the importance of cash flows to a business : View the you-tube videos below on cash flow. Discuss the following: - the difference of cash flow statements from balance sheets and net income.
Compute the annual payment : The lease required six annual payments, with the first payment due on December 31, 2010. Compute the annual payment
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.
In the black-scholes-merton option pricing formula : In the Black-Scholes-Merton option pricing formula N(d1) denotes (circle one)
Prepare all journal entries on spokane books : Spokane Company leased some equipment from another company on January 1, 2010, for a four-year period. Prepare all journal entries for 2010 on Spokane's books
What is the principal role of union in business environment : What is the principal role of a union in today's business environment? What is the purpose and effect of "Right-to-Work" laws in states that have enforced them?
Program stores test scores in two int variables : A program stores test scores in two int variables named myScore and expectedScore. Write the C++ code to compare the two scores

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd