Computers and Technology

/* 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"); } }}

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:50, nicoleskertich
You have written, as part of a school assignment, a research paper on the solar system. you want to share this paper on your school website. on which type of server will you upload it?
Answers: 1
image
Computers and Technology, 23.06.2019 11:20, 1tzM3
Http is the protocol that governs communications between web servers and web clients (i. e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
image
Computers and Technology, 23.06.2019 22:30, kayelynn003
How many points do i need before i can send a chat
Answers: 1
image
Computers and Technology, 24.06.2019 00:40, sierravick123owr441
Use a software program or a graphing utility with matrix capabilities to solve the system of linear equations using an inverse matrix. x1 + 2x2 โˆ’ x3 + 3x4 โˆ’ x5 = 6 x1 โˆ’ 3x2 + x3 + 2x4 โˆ’ x5 = โˆ’6 2x1 + x2 + x3 โˆ’ 3x4 + x5 = 3 x1 โˆ’ x2 + 2x3 + x4 โˆ’ x5 = โˆ’3 2x1 + x2 โˆ’ x3 + 2x4 + x5 = 5
Answers: 3
Do you know the correct answer?
/* write a program that prompts the user to enter two characters and displays the major and status r...

Questions in other subjects:

Konu
Social Studies, 15.12.2021 19:10