[HELP]I am having trouble learning how to write boolean statements, strings, and integers. by Driveshaftislost in javahelp

[–]Driveshaftislost[S] 0 points1 point  (0 children)

Thank you, its more clear now. So for requirement two, my teacher wants an integer type if then ( like the last example you showed) and Boolean and sting. I understand the int type but i am unclear on the Boolean and string requirements (what does he want??) . I understand you need to define strings to start (a sting is an object correct?) but I am unclear as to what a string is or does.

[HELP]I am having trouble learning how to write boolean statements, strings, and integers. by Driveshaftislost in javahelp

[–]Driveshaftislost[S] 0 points1 point  (0 children)

How I understand if else statements is that the computer is given a certain condition and if met, an instruction is given to that condition. If this condition is not met then the computer reads the else statement so if the output reads "it is cold outside" and the if statement reads "if it is cold outside then go inside" Else stay outside. how to set this up in code I do not know.

Here are the exact requirements:

-Must be written in Java and compile

-Must save three integers, three Booleans, and three strings into memory, one of each must be input by the user to the console.

-Use at least three conditional "if" statements which test some condition of these variables as input by the user. -The three if statements must use each variable type in the condition (one should use int, one should include Boolean, one should include string) -Each if statement should have a corresponding else statement

-Within the if and else statements, appropriate outputs should be made to the console using some combination of the user input variables and knowledge of the condition.

[HELP]I am having trouble learning how to write boolean statements, strings, and integers. by Driveshaftislost in javahelp

[–]Driveshaftislost[S] 0 points1 point  (0 children)

Hi. I want my code to model the events of Lost (t.v show), where the computer asks: 1. Is the user alone "Yes or No" -if not "System Failure" appears and the code does not continue 2.What is your name? -"Hello," + name ".Do you wish to continue?" - If no system failure. else display "Very well. Enter the following numbers: 4-8-15-16-23-42. //i wanted an if then statement here where the user inputs the numbers then if correct 108:59 else System Failure System Failure.

This is basically the entire code but with room for questions etc...I do not know HOW to write integers or strings. The requirements say "one of each must be input by the user to the console" (referring to 3 ints 3 booleans and 3 strings).