Answer to Question #264092 in C++ for Lyne

Question #264092

Create a C++ program using conditional statement. Read the worded problem below.

Supposed we have a client, he/she wanted you to create a program for his/her business.

He/She wanted to record the employee’s information. Now, on programmer’s side (You), we

have 3 buttons, the ADD, UPDATE, DELETE.

A. When we click DELETE button, there will be a notification telling the user of the program

if he/she wanted to delete the employee’s record. The pop-up information/display

when DELETE button is pressed: “Are you sure you want to delete this record?”

B. When the button ADD is pressed/triggered, it will display “Are you sure you wanted to

add this file?”

C. When the button UPDATE is pressed, it will display “Are you sure you want to update

this record?”


1
Expert's answer
2021-11-10T14:50:54-0500
#include<iostream>
using namespace std;

void Menu()
{
	cout << "\nPlease, make a choice from the following\n"
	<< "D - DELETE the employee's record\n"
	<< "A - ADD the employee's record\n"
	<< "U - UPDATE the employee's record\n"
	<< "Q - QUIT program\n";
	cout << "Your choice: ";
}

int main()
{
	char c;
	Menu();
	while (cin >> c)
	{
		if (c == 'A' || c == 'a')
		{
			cout << "Are you sure you wanted to add this file ?\n";
		}
		else if (c == 'D' || c == 'd')
		{
			cout << "Are you sure you want to delete this record ?\n";
		}
		else if (c == 'U' || c == 'u')
		{
			cout << "Are you sure you want to update this record ?\n";
		}
		else if (c == 'Q' || c == 'q')
		{
			break;
		}
		else
		{
			cout << "Make another choice!\n";
		}
		Menu();
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS