Thank you for visiting our site! You landed on this page because you entered a search term similar to this: java code convert mixed fraction to decimal, here's the result:
SAL Programming and Number Systems 5% Assigned: 1/26/2005 Due: 2/9/2005 at 4:00 PM |
Announcements |
|
1: Multiple Choice Questions 10 points |
I strongly recommend that you first do these multiple-choice problems
without using the simulator, a calculator, or referring to your notes. This is good practice
for the exam and can help you gauge how well you know the course material. After determining your
answer, then check your work.
|
2: Written Questions 25 points |
I strongly recommend that you first do these written problems without using the simulator, a calculator, or referring to your notes. This is good practice for the exam and can help you gauge how well you know the course material. After determining your answer, then check your work. To indicate a repeating fraction in your text file answers for the questions in this part of the assignment follow the fraction with ... as in 1.23... which means 1.2323232323 and so on.
|
3: Programming Work 65 points |
Write a SAL program that reads in three non-negative integers that are
entered by the program user. The first is a decimal integer in the range from 2 to 16 inclusive. It is used to specify
the base of the second and third integers, which represent the dimensions (width, length) of a surface. The program uses
these integers to calculate the area of that surface, which is displayed in bases 10 and 16.
Note that we are completely ignoring units in this program. We'll assume that the units for the width and length integers are the same so that the area calculation is valid. Here's a sample execution of the program (user input in bold): This program prints the area of a surface. Enter the integers' base (in decimal): 2 Enter the integer length: 100 Enter the integer width: 100 The area in decimal is 16 units. The area in hexadecimal is 0x10 units. Here's another sample execution of the program (user input in bold): This program prints the area of a surface. Enter the integers' base (in decimal): 10 Enter the integer length: 12 Enter the integer width: 4 The area in decimal is 48 units. The area in hexadecimal is 0x30 units. Before submitting your programming work, make sure that you have followed the Standards for Grading Programs. Especially make sure you've documented your program and have organized it into procedures. Regarding Errors and Input: As specified in the grading standards for programs, your programs must handle invalid input in a reasonable manner. For this assignment, if invalid input is entered for the base specified, display a clear error message and ask the user to re-input the value. You do not need to worry about the problem of integer overflow. For digits values 10 - 15 you only need to have your programs handle lowercase (a-f) though a better progrm would be able to accept both uppercase and lowercase. WARNING: b, j, m, M are predefined and will cause headaches if you use them as labels. As a rule of thumb I suggests that you use names that are at least 2 characters long, e.g., c1 or i1. |
What to Submit |
You are to turn in the
following by the due date and time. Refer to the assignments
page for information about how to submit your written and programming work. Also refer to
the late policy if necessary.
Electronically submit the following:
|
2/7/2005 , |