subject

1. the program should have the following specifications:
a. declare variables x, y and z with ‘int’ data types without initializing them.
b. the program should accept inputs for the declared variables as follows:
x=0; y=0; and z=0
c. using the if statement, implement the following constraints:
i. check if the value of variable x and y are equal then increment the value of x by 1.
ii. check if the value of variable x and z are equal then increment the value of x by 1
iii. check if the value of variable y and z are equal then increment the value of y and z by the value x.
d. print the sum of all variables.
e. save, compile and run the program.
1: what is the current value of variable x?
a: 0
b: 1
c: 2
d: 3
2: what is the current value of variable y?
a: 0
b: 1
c: 2
d: 3
3: what is the current value of variable z?
a: 0
b: 1
c: 2
d: 3
4: what is the output of the program?
a: 0
b: 2
c: 4
d: 6
2. modify the java file that you have created by adding the following codes in your main method:
while(y< =5) {
x++;
y++;
z++;
}
a. print the sum of all variables.
b. save, compile and run the program.
5: what is the current value of variable x?
a: 5
b: 6
c: 7
d: 8
6: what is the current value of variable y?
a: 5
b: 6
c: 7
d: 8
7: what is the current value of variable z?
a: 5
b: 6
c: 7
d: 8
8: what is the output of the program?
a: 15
b: 16
c: 17
d: 18
e: none of the above
3. open the file again and add the following codes in the main method:
for(y = 1; y
{
y=x;
}
system. out. print(y);
a. save, compile and run the program.
9: what is the current value of variable y?
a: 5
b: 6
c: 7
d: 8
10: what is the output of the program?
a: 5
b: 6
c: 7
d: 8
e: none of the above
4. write java program for a temperature converter with the following specifications:
a. the program should display a menu as follows:
temperature converter main menu
[1] conversion from celsius to fahrenheit
[2] conversion from fahrenheit to celsius
[3] exit
choose an option
b. option 1 should ask for a temperature input and convert it to fahrenheit. display the converted temperature. assume that the user will only input numerical value.
c. option 2 should ask for a temperature input and convert it to celsius. display the converted temperature. assume that the user will only input numerical value.
d. the program returns to the main menu after each display from the option, and when an invalid input of the option is encountered.
e. validate the option input. only 1, 2 and 3 are acceptable, otherwise, display a message error and return to the main menu.
f. exit option terminates the program.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
What is the most popular genre of video games?
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
Answers: 1
question
Computers and Technology, 24.06.2019 17:40
Anewly established internet company with 40 employees needs your advice. they are looking for a collaboration tool and have narrowed their choices to gotomeeting, webex, and my web conferences. after reading the information presented in this chapter and other sources, prepare a two- page document ( double spaced) that includes two advantages and two disadvantages of each tool. which one is your final recommendation? why did you choose that tool over the other two?
Answers: 3
question
Computers and Technology, 25.06.2019 01:20
Jason typically uses the internet to buy various items. it the total cost of all of the items ordered, at one time, is $250 or more, then the shipping and handling is free, otherwise the shipping and handling is $15 per item. design an algorithm that prompts jason to enter the number of items ordered and the price of each item. (remember cost = number of items order times price) the algorithm then outputs the total billing amount including shipping and handling. your algorithm must use a loop (repetition structure) to get the number and price of each item. write this in algorithm format not program code format.
Answers: 2
You know the right answer?
1. the program should have the following specifications:
a. declare variables x, y and z with...
Questions
question
Mathematics, 18.10.2020 08:01
question
Mathematics, 18.10.2020 08:01
question
Arts, 18.10.2020 08:01
question
English, 18.10.2020 08:01
Questions on the website: 13722360