subject

/* write a program that prompts the user to enter two characters and displays the major and status represented in the characters. the first character indicates the major and the second is number character 1, 2, 3, 4, which indicates whether a student is a freshman, sophomore, junior, or senior. suppose the following chracters are used to denote the majors: m: mathematics c: computer science i: information technology*/import java. util. scanner; public class exercise_04_18{ public static void main(string[] args) { scanner in = new scanner(system. in); system. out. print("enter two characters: "); string status = in. next(); char major = character. touppercase(status. charat(0)); char year = status. charat(1); string coursename = ""; string yearname = ""; if (major == 'm' || major == 'i' || major == 'c') { switch(major) { case 'm': coursename = "mathematics"; break; case 'c': coursename = "computer science"; break; case 'i': coursename = "information technology"; break; default: break; } switch(year) { case '1': yearname = "freshman"; break; case '2': yearname = "sophmore"; break; case '3': yearname = "junior"; break; case '4': yearname = "senior"; break; default: break; } system. out. printf("%s %s%n", coursename, yearname); } else{ system. out. printf("invalid input.%n"); } }}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:30
Ihave a singular monitor that is a tv for my computer. recently, i took apart my computer and put it back together. when i put in the hdmi cord and booted the computer to see if it worked, the computer turned on fine but the screen was blue with "hdmi no signal." i've tried everything that doesn't require buying spare parts, any answer is appreciated!
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Font size, font style, and are all aspects of character formatting.
Answers: 2
question
Computers and Technology, 24.06.2019 07:00
Why would a business likely use a java applet - to back up their data files for the business - to create a program that a customer can launch in their web browser - to create music on a powerpoint presentation - to organize files on their company directory
Answers: 3
question
Computers and Technology, 24.06.2019 13:00
Ais a built in formula in spread spread a is any math process such as addition or subtraction. options are function and operation
Answers: 1
You know the right answer?
/* write a program that prompts the user to enter two characters and displays the major and status r...
Questions
question
Mathematics, 02.02.2021 04:10
question
Mathematics, 02.02.2021 04:10
question
Mathematics, 02.02.2021 04:10
question
History, 02.02.2021 04:10
question
Mathematics, 02.02.2021 04:10
question
Arts, 02.02.2021 04:10
Questions on the website: 13722363