Answer to Question #239149 in C++ for dillaksha

Question #239149

ask the user to enter the year (can be 1,2,3,) &corce (HNDIT,HNDM,HNDA)

if year is 2&corece is HNDIT show him "it is time to garduate soon"

if year is 2&corece is HNDA show him "it is time to garduwate in 2 years "

if year is 3&corece is HNDM show him "it is time to garduwate soon "

if is 1 show him "you have more time in garduwate"




1
Expert's answer
2021-09-19T08:05:51-0400
#include<iostream>
#include<string>
using namespace std;
int main(){
	cout<<"Enter year\n";
	int year;
	cin>>year;
	cout<<"Enter course\n";
	string course;
	cin>>course;
	if(year==2 &&  course =="HNDIT"){
		cout<<"It is time to graduate soon\n";
	}
	else if(year==2 && course=="HNDA"){
		cout<<"It is time to graduate in 2 years\n";
	}
	else if(year==3 && course=="HNDM"){
		cout<<"It is time to graduate soon\n";
		
	}
	else if(year==1){
		cout<<"You have more time to graduate\n";
	}
}

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