Write a program that ask the questions “Do you know the capital of ALASKA”. The
program should display the statement “WRONG!!Please try again” when incorrect
answer is given and it stop until the user input the correct answer.
Note : Capital of ALASKA is Juneau
1
Expert's answer
2013-02-22T06:08:05-0500
# include <iostream> # include <string >
using namespace std;
int main(){
string a; while(true){ cout<<"Enter Capital of Alyska:"; cin>>a; if (a.compare("Juneau")==0){cout<<"YES!\n"; break;} cout<<"Wrong, try again\n"; } system("PAUSE"); return 0; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment