Skip to content

1ibertyy/Recitation1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Recitation 1 - Variables, input, and casting (Java)

Learning Objective:

i. Develop experience with Java input and output functionality.

ii. Use type casting to force type conversion without producing a compiler error.

iii. Use different primitive types in Java.


Implement the below instructions in the provided BasicInpupt.java file.

  1. Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output those four values on a single line separated by a space.
Enter integer:
99
Enter double:
3.77
Enter character:
z
Enter string:
Howdy
99 3.77 z Howdy
  1. Extend to also output in reverse.
Enter integer:
99
Enter double:
3.77
Enter character:
z
Enter string:
Howdy
99 3.77 z Howdy
Howdy z 3.77 99
  1. Extend to cast the double to an integer, and output that integer.
Enter integer:
99
Enter double:
3.77
Enter character:
z
Enter string:
Howdy
99 3.77 z Howdy
Howdy z 3.77 99
3.77 cast to an integer is 3

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages