Question: 1. Write a program that: a. Defines three integer variables b. Initializes them to 20, 500, 1000 c. Prints them on a single line separated
1. Write a program that: a. Defines three integer variables b. Initializes them to 20, 500, 1000 c. Prints them on a single line separated by spaces with the message below. The numbers are: 20 500 1000 2. Write a program segment that a. b. c. Declares a variable called gpa to store your current gpa Assigns a value (your current gpa) to gpa Writes to console with the message below where x.x is your gpa My current gpa is xx 3. Extend (Add to) program segment in 2: a. Declare another variable called GPA to store the value of your new gpa b. Place line comments like"new gpa, and 'current gpa, appropriately c. Assign current gpa plus .25 to new GPA d. Writes to console with the message below where x.x is your new GPA Next semester my gpa will be x.x 4. Write a program segment that: a. Declares a character variable named MI or middleInitial b. Assign a value to MI c. Print the value of the MI with a text like the following where X is the value of your middlelnitial My middle initial is: X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
