Explore BrainMass
Share

Legal Java variable names and a Basic Program.

This program calculates profits and sales prices for a furniture company.

-First calculate the profit, then calculate the sales price, then calculate the profit when the sale price used.

-Profit is defined as the retail price minus the wholesale price.

-The sales price 20% deducted from the retail price.

-The sales profit is defined as the sales price minus the wholesale price.

-Perform the appropriate calculations for the assignment statement.

Attachments

Solution Preview

Dear student,

First of all thank you for choosing me to help you in understanding more about Java. Please find the solution attached.

Thanks,
Kavita Narang

A.)
Legal Identifiers—
myIDNumber
yourIDNumber
this_is_a_year
number
floatNum
May13
Number
NUMBER // legal identifier can have all the characters in capital and is different from "Number" and "number"
$number // legal identifier can start with $ symbol

Illegal Identifiers ----
short
110number
One Number

B.) Declare and initialize constants to represent following values—
// constants in java are declared with ...

Solution Summary

The solution contains the complete program. The code is completely commented and follows all the guidelines for easier and faster understanding of the Java basics. Grab the solution and enjoy.

$2.19