Preview

Comp 122 Week 1 Ilab

Satisfactory Essays
Open Document
Open Document
662 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Comp 122 Week 1 Ilab
COMP122
Week 1 iLab - Part 2

Complete the following two programs:

Programming Problem 1

John wants to know the values of the area and perimeter of a rectangle. John can take measurements of the length and width of the rectangle in inches. John's measurements are expected to be accurate to within 0.1 inch.

1. Identify the inputs and outputs of the problem.
Inputs
Double Length
Double Width
Output:
Double Area
Double Perimeter

2. Identify the processing needed to convert the inputs to the outputs.
Area= length*width
Perimeter= 2*(length+width)

3. Design an algorithm in pseudocode to solve the problem. Make sure to include steps to get each input and to report each output.
A. Declare input and output variable
B. read length and width
C. calculate area and the perimeter
D. output the variables

4. Identify two test cases, one using whole number values, and one using decimal number values. For each of the two test cases show what inputs you will use and what your expected outputs should be.
Expected:
Length | Width | Area | Perimeter | | | | | | | | | | | | |

Actual: Length | Width | Area | Perimeter | | | | | | | | | | | | |

5. Write the program to implement your algorithm. Test your program using your test cases. Did your program produce the values predicted in your test cases? Explain.

Programming Problem 2

Shirlee is working with a measurement tool that reports measurements in centimeters. Since Shirlee is unfamiliar with centimeters, she would like her centimeter measurements to be converted into yards, feet, and inches. She would also like the result to be properly rounded to the nearest inch. As an example, if the measurement is 312 centimeters, this should be converted to 3 yards, 1 foot, and 3 inches.

1. Identify the inputs and outputs of the problem.
Input: float centimeters
Output: the amount of centimeters to be converted

2. Identify the processing needed

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Measure the length of the following objects using the most appropriate units. Record your measurements. Convert this unit into the other units in the table.…

    • 1018 Words
    • 11 Pages
    Satisfactory Essays
  • Satisfactory Essays

    NT1210 Week 1 Labs 1

    • 3680 Words
    • 20 Pages

    1. Convert the decimal value 127 to binary. Explain the process of conversion that you used.…

    • 3680 Words
    • 20 Pages
    Satisfactory Essays
  • Better Essays

    Week 3 iLab Report

    • 1123 Words
    • 4 Pages

    * Answer each of the following questions using the sequence and data from the iLab instructions. Answer all questions in full college-level sentences.…

    • 1123 Words
    • 4 Pages
    Better Essays
  • Satisfactory Essays

    = z) return true; else return false; } Problem 5 a. Output: 720 b. Output: 0 c. Output: 71 d. Output: 362880 Problem 6 a. Output: “Take Programming I.” b. Output:…

    • 188 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Nt1310 Assignment 1

    • 407 Words
    • 2 Pages

    II. Analysis. The intent for this program is to calculate the square footage of a house with no more than four rooms that are rectangular in shape. In order to do this we will identify each room, input the length (l) and width (w) of each room, multiply the l x w of each room to get the square foot, and add the sum of each room to secure the total square footage of the house.…

    • 407 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Week 4 iLab

    • 423 Words
    • 2 Pages

    Under Object Statistics, select Group A WAP / Data Traffic Recvd (bits/sec) and Group B WAP / Data Traffic Recvd (bits/sec). Change the presentation style to Overlaid Statistics. Use to this DES Graphs window (as shown below) and paste it into your lab document.…

    • 423 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Week 4 Ilab

    • 813 Words
    • 4 Pages

    * Finally, we will change the probability of a success to ¾. In column C4 enter the words ‘three fourths’ as the variable name. Again, use similar steps to that given above in order to calculate the probabilities for this column. The only difference is in Event probability: use 0.75.…

    • 813 Words
    • 4 Pages
    Powerful Essays
  • Satisfactory Essays

    Netw250 Week 1 Ilabs

    • 290 Words
    • 2 Pages

    Answer: Chat session was not possible due availability of students, however I did send out request for chat sessions for three or four days.…

    • 290 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    geometry semester 2 notes

    • 1828 Words
    • 8 Pages

    * Finding perimeter on the coordinate plane may require the use of the distance formula: (2 x width) + (2 x height)…

    • 1828 Words
    • 8 Pages
    Powerful Essays
  • Satisfactory Essays

    Ch. 2 Modules

    • 381 Words
    • 3 Pages

    5. Create pseudocode that shows the logic for a program that generates a random number, then asks the user to think of a number between 1 and 10. Then display the randomly…

    • 381 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    CTS 2437 Final Exam

    • 630 Words
    • 4 Pages

    You should provide (1) a screen shot of your solution and (2) code for your solution, copied/pasted into this document. Each problem is worth 20 points.…

    • 630 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    to the number 15, each size being the fourth part of an inch as aforsaid; so that a Shooe of the long fifteens is in length 12 inches…

    • 1001 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    You must compute and analyze items (a) through (h) using a Microsoft Excel spreadsheet. Make sure that all calculations can be seen in the background of the applicable spreadsheet cells. In other words, leave an audit trail so that others can see how you arrived at your calculations and analysis. Items (i), (j), and (k) should be submitted in Microsoft Word.…

    • 348 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    * * * * * * * * * * 14) Program to calculate lucky number. 15) Write a program to calculate the result of the series accurate up to 7th digit. x+x3/3!+x5/5!+………………. 16) An electric power distribution company charges its domestic consumers as follows. Consumption Units Rate of Charge 0-200 Rs.0.50 per unit 201-400 Rs.100 plus Rs.0.65 per unit excess 200 401-600 Rs.230 plus Rs.0.80 per unit excess of 400. Write a C program that reads the customer number and power consumed and prints the amount to be paid by the customer. 17) Program to find the roots of the quadratic equation using bisection method.…

    • 1735 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    Algorithm

    • 506 Words
    • 3 Pages

    This Assignment was done to show the methods of algorithm. It outlines the meaning of algorithm and steps to be carried out to complete a give problem. Examples were also shown for the methods of representing algorithm.…

    • 506 Words
    • 3 Pages
    Satisfactory Essays

Related Topics