Question
Programming Fundamentals I Sec. 602 Assignment #1 1. (40 points) Briefly define (one to two sentences) each of the following ten terms. Variable Literal Declaration
Programming Fundamentals I Sec. 602
Assignment #1
1. (40 points) Briefly define (one to two sentences) each of the following ten terms.
- Variable
- Literal
- Declaration
- Initialization
- Assignment
- Class
- Method
- Syntax
- Comment
- Operator
2. (15 points) Provide a variable declaration and initialization using each of the eight primitive data types in Java. The variable names can be any of your choosing.
3. (15 points) For each of the following statements, write a line of code that achieves the same outcome but uses a combined assignment operator instead.
total = total + 32.58;
capacity = capacity / 4;
remainder = remainder % 2;
greeting = greeting + name;
4. (15 points) What is the problem with the following lines of code and how is that problem resolved? (Hint: Focus on the conversions between data types.)
long toTheMoon = 238900L;
double toTheSun = 92955807;
long totalDistance = toTheMoon + toTheSun;
5. (15 points) Briefly describe the process (no code needed) of requesting the user to input their age and then displaying a message with that age. This process uses the JOptionPane class and handles all input and output with input and message dialog boxes.
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