Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java, we always specify the data type when we're declaring a variable. The syntax is: dataType variableName For this practice assignment, you get to
In Java, we always specify the data type when we're declaring a variable. The syntax is:
dataType variableName
For this practice assignment, you get to write a simple class named JavaVariables. Declare a main method in that class. In that main method, have it do the foll
Declare an int variable named nine and initialize it to your number
Declare a string variable named subject and initialize it to CPSC
Declare an int variable named courseNumber and initialize it to
Declare a char variable named courseSuffix and initialize it to notice that in Java, strings use two double quotes whereas chars use two
Declare a boolean variable named isonline but do not initialize when declaring it
Declare a double variable named points but do not initialize when declaring it
Assign isonline to reflect if you are taking this course online or inperson do this on a different line of code than the declaration
Assign points to be do this on a different line of code than the declaration
Display the value stored in the nineeg variable on its own line For example, something like:
Display the following output, using the variables above:
CPSC online: true: points
or
CPSC online: false points
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started