CS1160 HW for jamesblent

0 comments

Use while loops for first two programs below.

P4.3.

P4.5.

P4.13.  Your output should not include decimal points or numbers after the decimal.  You may use a method in the Math class to complete this assignment.  Your output should begin and look similar to the following below where the ‘^’ means ‘raised to the power of’:

Output:

2^0 —> 1

2^1 —> 2

2^3 —> 8

 

Hint: Remember, you can cast double numbers (which have decimal points) to whole numbers such as integers.

For example:

double x = 2.5;

int y = (int) x; // The (int) in front means drop the numbers after the decimal point. y <- 2

 

P4.27. Use www.xe.com to find out and use the exchange rates from February 26, 2014 to complete this problem.

 

Items to submit

– For the review exercises, only a consolidated Microsoft Word document called yourlastname_hw_4-1_review.doc.

– Full specifications for each programming problem combined into one consolidated Microsoft Word document called yourlastname_hw_4-1_specifications.doc.

– Exported Netbeans project (.zip) for each programming problem. For example, problem 4.2 should be called yourlastname_hw4-1_netbeans_4-2.zip.

– Screen shot of each running program combined into one consolidated Word document called yourlastname_hw4-1_snapshot.doc.

– One consolidated Microsoft Word document called yourlastname_hw4-1_output.doc with 1 sample of output per problem from your program.

 

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}