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, 23.06.2019 03:30
Hashtags serve to identify the topic of a given tweet true false
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
question
Computers and Technology, 23.06.2019 22:00
Jackson, who works in the finance department of a company, is holding a seminar for other employees on how to file taxes. only three employees sign up to attend the seminar. which device can he use to share his presentation with a group of three employees?
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
Carlos, an algebra teacher, is creating a series of powerpoint presentations to use during class lectures. after writing, formatting, and stylizing the first presentation, he would like to begin writing the next presentation. he plans to insert all-new content, but he wants to have the same formatting and style as in the first one. what would be the most efficient way for carlos to begin creating the new presentation? going under the file tab and opening the first presentation, deleting all content from each page, and adding new content going under the file tab and clicking on new in the left pane, then choosing new from existing going under the design tab and clicking on themes, then selecting the theme that was used for the first template going under the design tab and opening the template that was created for the first presentation
Answers: 2
You know the right answer?
1. the program should have the following specifications:
a. declare variables x, y and z with...
Questions
Questions on the website: 13722363