Write an algorithm that converts a decimal number

Assignment Help Data Structure & Algorithms
Reference no: EM13314963

Program Design Lab
 
Each person in your team will complete: 
 
  One sequence problem (problem 1 or 2). 
  One selection problem (problems 3, 4, or 5)
 
Each team member should choose a different pair of problems. 
 
When you are finished you will submit a single file containing all of your answers to moodle. This file can be in .doc, .docx (Word) or .rtf (WordPad) format. Don't spend a lot of time making pretty tables. For the IPO charts you don't necessarily need to use a table. You can list the three sections one above the other on the page:

Example:  IPO chart
Input
firstNumber
secondNumber
Processing
Get numbers to add
Add numbers together
Display sum
Output
sum

You can list your specific solution steps (your algorithm) with numbers for each step. This will make it easier to write your chart for testing the solution. Example:

Example:  Algorithm
1.  Prompt user for firstNumber 
2.  Get firstNumber 
3.  Prompt user for secondNumber 
4.  Get secondNumber 
5.   sum = firstNumber + secondNumber
6.  Display sum

When you show how you tested your solution (desk checking) you do need to make sure that everything is organized in a chart. If you know how to make tables, this is the easiest way to organize your chart. Otherwise, you can use tabs. Just make sure you keep your columns straight.  

Practice with Sequence 
 
For the problem you choose, complete the problem solving process discussed in class.  You should submit written evidence of the process in the form of:  a list of assumptions you've made to clarify the problem, an IPO chart, an algorithm and documentation of your testing.
 
 
1.  Write an algorithm that converts a decimal number between 0 and 15 into its 4 bit unsigned binary representation.
 
 
2.  Write an algorithm that converts a linear measurement in feet and inches into meters.  One inch is equivalent to 2.54 centimeters.

Practice with Selection
 
Complete the problem solving process discussed in class for the problem you choose.  Your solution must use a selection control structure. You should submit written evidence of the process in the form of:  a list of assumptions you've made to clarify the problem, an IPO chart,
an algorithm and documentation of your testing.
 
3.  Write an algorithm that converts a decimal number between 0 and 15 into its hexadecimal representation.
 
4.  Write an algorithm that can be used to calculate the commission earned in a real estate transaction.  The chart below describes the formulas used to calculate the commission.

 5.  Write an algorithm that can be used to calculate car insurance rates.  Rates for male drivers and young female drivers are determined by adding a surcharge to the rate for female drivers over age 25.
 
Older than 25  25 or younger
Male  7% more than base rate  10% more than base rate
Female  Base rate  5% more than base rate

Reference no: EM13314963

Questions Cloud

Find the weight and mass of the disk in us and si units : A disk is made of material having a SG = 8.3 and is 500 in diameter and a thickness of 10mm. Find the a) weight and b) mass of the disk in US and SI units.
Find the absolute value of the magnitude of force vector : Find the absolute value of the magnitude of force vector B if the resultant force= 1000 lb, force vector A= 1000 lb, and the resultant forms a 45 degree angle with B, and vector B runs parallel to the y axis.
Determine the velocity and position as functions of time : A particle is moving with a velocity of Vo when s=0 and t=0. If it is subjected to a deceleration of a = (-K)v^3, where K is a constant, determine its velocity and position as functions of time.
Determine the spiral curve length to satisfy all requirement : A horizontal curve on a two-lane highway is designed with a 818.51ft radius, 12ft lane, superelevation 6.4%, and a 50mph design speed. Deflection angle is 90 degree. The maximum relative gradient is 0.50.
Write an algorithm that converts a decimal number : Write an algorithm that can be used to calculate the commission earned in a real estate transaction.  The chart below describes the formulas used to calculate the commission.
What is the hight of the water in the cylinder : A cylinder 25 cm long is partly filed with water. A loudspeaker held over the cylinder causes the air column to resonate, what is the hight of the water in the cylinder
What is wrong with recruitment policy of the company : What is wrong with the recruitment policy of the company and why did Mr. Sashidhar's resignation surprise the General Manager?
What is arc distance of one second of longitude and latitude : Given a mean earth radius of 20,906,000 ft, and an observation latitude of N 33 degrees, what is the arc distance of one second of longitude and one second of latitude
Explain how you found the object and image distances : Draw a careful diagram of the set up of the reference point method of finding an image. explain how you found the object and image distances

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Decrypting the ciphertext to recover the plaintext

If you get ciphertext message YPHDCRPBEQTAA, decrypt to recover plaintext.

  A binary search tree for link information

A binary search tree with N nodes has N + 1 null references, half the space allocated in a binary search tree for link information is wasted. Suppose that if a node has a null left child, we make its left child link to its inorder predecessor, and if..

  Analyzing network problem

Assume you are the Systems Analyst at a producing corporation in Seattle, WA. A Systems Analyst in your company's New York office sends you a trace file to examine.

  Portfolio planning using optimization

Set this problem up as a linear programming model in Excel, and use Solver to determine how the $10 million should be invested. What is the overall return (in dollars terms)

  Algorithm to minimize average difference between height

The problem is to assign each skier a ski to minimize the average difference between height of a skier and his/her ski. Give pseudocode and write its asymptotic running time.

  Treat the problem as a directed graph with n nodes

Two distinct words can be joined if one, two or three of the letters at the end of the first word are the same as the letters at the beginning of the second word, and only if the letter/letters are in the same order.

  Separate inventory database

A 20-year old corporation, SewWorld, comprised of 6-locations in three states, sells sewing machines, sewing related software, and accessories. Each store sells between 3-5 different brands of sewing equipments.

  Describe the jsp life cycle

Draw a diagram of the various events and transformations. Describe how you might implement logging in as used in the workshops using the session mechanism explaining what Java classes are involved and using code snippets.

  Chinese remainder theory

For RSA signature, let p=17 and q=43. Design a digital signature for the message m=161, where the hashing function is the identity function and the computation at the signer's side is performed through the Chinese Remainder Theory.

  Find values of n insertion sort beat merge sort

For inputs of size n, insertion sort runs in 8n 2 steps, where as merge sort runs in 64* nlog base 2 n steps. For which values of n odes insertion sort beat merge sort?

  What is complexity of the gnome sort for the average case

What is the complexity of the gnome sort for the average case? Justify your answer. The justification can be based on approximate calculations.

  Create algorithm to read file of employee records

Create the algorithm which will read a file of employee records and produce the weekly report of gross earnings for those employees.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd