Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

  1. Variable

  1. Literal

  1. Declaration

  1. Initialization

  1. Assignment

  1. Class

  1. Method

  1. Syntax

  1. Comment

  1. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions