Preview

UNIT 2

Satisfactory Essays
Open Document
Open Document
470 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
UNIT 2
PT1420 - Unit 2 Homework and Lab Assignment

Unit 2 Assignment 1: Homework (material from Chapter 2of your text book)
1.) What is pseudocode? An informal language used to develop a programs design
2.) Computer programs typically perform what 3 steps. Input, Processing, and Output
3.) What 2 things must you normally specify in a variable declaration.
Variable name and data type
4.) Write assignment statements that perform the following operations with the variables a, b, and c:
a. Adds 2 to a and stores the result in b b=a+2
b. Multiples b times 4 and stores the result in a a=bx4
c. Divides a by 3.14 and stores the result in b b=a/3.14
d. Subtracts 8 from b and stores the result in a a=b-8
5.) Write the pseudocode for a program that will determine the average miles per gallon a car gets. (Inputs should be miles driven and gallons of gas used)
Miles driven= Distance
Gallons of gas used=Gas

*****************************************************************

Unit 2 Labs

Problem:

Write a program that will calculate the cost of installing fiber optic cable at a cost of .87 per foot for a company. Your program should display the company name, number of feet installed, and the total cost for the installation.

1.) 2.1: Pseudocode
Type in your answers below where the question marks are shown based on the above problem

Variable Table

Purpose of Variable
Variable Name
Stores the cost of fiber fiberCost Stores the company name compName Stores number of feet to be installed feet Stores calculated cost of installed fiber
Totalcost

Pseudocode:

Display “Welcome to the Fiber Optic Calculator Program”
Set fiberCost = fibercost
Display “What is the Company Name?”
Input compName
Display “How many feet of fiber will be installed?”
Input feet
Set feet * fiberCost
Display “Company Name: “,("company name: " & compName)
Display“Feet of cable installed: (" total feet installed: " & feet)
Display “Total cost: $”, ("total cost is: $" & totalcost)

2.) 2.2: Flowchart.
Use

You May Also Find These Documents Helpful

  • Satisfactory Essays

    unit 3

    • 313 Words
    • 2 Pages

    4. Assume the variables result, w, x, y , and z are integers, and that w=5, x=4, y=8, and z=2. What value will be stored in result in each of the following statements?…

    • 313 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Step 2: Think of good variable names for the following pieces of data that will need to be stored with in this program.…

    • 777 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit 2

    • 726 Words
    • 3 Pages

    To receive credit for completing the questionnaire, you need to submit your questions and answers to the dropbox. Follow these instructions to do so:…

    • 726 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Unit 2

    • 637 Words
    • 3 Pages

    The Human Rights Act applies to everyone within the country as it makes sure everyone is treated the same but it could be in different ways. This act allows students to have freedom of thought and religion. People are allowed to have and voice their own opinions but they have to take into consideration not everyone believes the same and they may disagree with their opinion. It helps people to become their own individual and to express themselves in a healthy way. This act also allows everyone to have the right to further and higher education within their own county.…

    • 637 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Unit 2

    • 1276 Words
    • 6 Pages

    You have been given the job of producing a prospectus into the work of a science technician focussing on methods of communication in the workplace and reasons why communication is important.…

    • 1276 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit Two

    • 579 Words
    • 2 Pages

    2. What type of recording do you think would be the most useful to crime…

    • 579 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit Two

    • 307 Words
    • 1 Page

    1. What is a pinhole camera? How do we know that these devices existed before the nineteenth century?…

    • 307 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Unit 2 D2

    • 306 Words
    • 2 Pages

    One disadvantage of Ratios is tools of quantitative analysis, which ignore qualitative points of view. For example the stock turn over ration and Asset turnover only look at the quantity and not if the quality of the product is up to standard.…

    • 306 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Unit 3

    • 2650 Words
    • 31 Pages

    On food labelling nutritional information must be showing the amount of each of the following in 100g or 100ml;…

    • 2650 Words
    • 31 Pages
    Good Essays
  • Powerful Essays

    Unit 1

    • 2413 Words
    • 10 Pages

    Question 1. Describe the products and services of a commercial, a public and a third sector organisations in your local area.…

    • 2413 Words
    • 10 Pages
    Powerful Essays
  • Satisfactory Essays

    PT1420 Chapter 3 Review

    • 1062 Words
    • 8 Pages

    6. Write a pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0.…

    • 1062 Words
    • 8 Pages
    Satisfactory Essays
  • Good Essays

    UNIT 2

    • 1340 Words
    • 5 Pages

    UNIT 2 PRINCIPLES OF DIGNITY IN ADULT HEALTH AND SOCIAL CARE PRACTICE BY MARIE BROWN…

    • 1340 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    8. Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total.…

    • 748 Words
    • 3 Pages
    Powerful Essays
  • Satisfactory Essays

    Unit 2

    • 301 Words
    • 2 Pages

    The New Mexico State legislature has enacted an express disqualification from benefits applicable to those persons found by the Department to have been discharged from their work for misconduct connected with their work.…

    • 301 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Unit 3

    • 2023 Words
    • 9 Pages

    E1 - current laws that influence working practices in a setting for children are -United Nations Convention on the Rights of the Child 1989/1991 , Children Act 1989 , Children Act 2004 , Equality Act 2006 , speacial educational needs and disability act 2001.…

    • 2023 Words
    • 9 Pages
    Powerful Essays