lab 2b CSCI110 – Fundamentals of Computer Science

profileSam1
LAB2A.cpp

// LAB2A.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <string> using namespace std; int main() { bool flag = true; string grade; string answer; while (flag); { cout << "Please enter your grade"; cin >> grade; if (grade == "A+") cout << "Your numeric score is " << "4.0" << endl; else if (grade == "A") cout << "Your numeric score is " << "4.0 " << endl; else cout << "Your numeric score is " << "unknown " << endl; cout << "Do you want to continue (y/n) ?" << endl; cin >> answer; if (answer != "y") flag = false; } system("pause"); return 0; }