Preview

Inch and Lt

Satisfactory Essays
Open Document
Open Document
1077 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Inch and Lt
COMP122
Week 1 Homework

Part 1: Complete the following problems.

1. What is machine code? Why is it preferable to write programs in a high level language such as C++?
A: The machine code is the language which the computer hardware understands and executes. It is preferable to write programs in a high level language such as C ++ because it is much easier to understand and learn this machine language.
2. What does a compiler do? What kinds of errors are reported by a compiler?
A: A computer translates high level language into machine code. While a compiler reports errors such as syntax errors.

3. What does the linker do?
A: A linker takes one or more machine code modules generated by a compiler and combines them into a single executable program.

4. What is an algorithm?
A: An algorithm is a list of instructions set up for completing a task

5. Bob enters a pizza shop and notices there are three different sizes of pizzas available. Sizes are given as the diameter of the pizza in inches. The cost of a pizza is based on the size. Bob would like to know which size of pizza has the lowest cost per square inch.

a. Identify the inputs and outputs for this problem. A: Inputs are the diameter and cost of each of the three different size pizzas Outputs are the size of pizza with the lowest cost per inch b. Identify the processing needed to convert the inputs to the outputs. A: Area of each pizza in square inches = pi * (diameter / 2)^2 Cost per square inch = cost / area c. Design an algorithm in pseudocode to solve this problem. Make sure to include steps to get each input and generate each output. 1. Get diameter of first size pizza and cost of first person 2. Find area of first pizza 3. Find cost per square inch of first pizza 4. Get diameter of second size pizza 5. Find area of second pizza 6. Find cost per square inch of second pizza 7. Get diameter of third pizza 8. Get cost of third pizza 9.

You May Also Find These Documents Helpful

  • Good Essays

    Food Booth Case Study

    • 1116 Words
    • 5 Pages

    Julia Robertson, a senior at Tech, explores various options to support her final year at school and weighs the option of hiring a food booth outside the institute for football games as she knows from her personal experience that during the games, people eat lot of food.…

    • 1116 Words
    • 5 Pages
    Good Essays
  • Good Essays

    2. Compare cost per square inch of pizza for each pan size offered by a restaurant.…

    • 1753 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    Homework Week 2

    • 743 Words
    • 3 Pages

    2. What does a compiler do? What kinds of errors are reported by a compiler?…

    • 743 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    5. Technology advances have affected the market for computers by increasing the supply causing a shift to the right, which has also increased the demand for computer software, also lowering the price. As for typewriters it has decreased the demand because computers are becoming more affordable because they are cheaper to make.…

    • 478 Words
    • 2 Pages
    Good Essays
  • Good Essays

    pt1420 exam review

    • 738 Words
    • 3 Pages

    1 - Design the Program2 - Write the Code3 - Correct Syntax Errors4 - Test the Executable Code…

    • 738 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Week 3 Assignment

    • 497 Words
    • 2 Pages

    Again, six workers. The rate for each is the same, so minimal cost per pizza is the same as production per worker.…

    • 497 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    ECN 5015 Midterm

    • 3237 Words
    • 21 Pages

    mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"MS Mincho"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} A restaurant currently has two cooks and ten waiters. Cooks earn $10 an hour and waiters earn $5 an hour. The last cook added 40 meals served to total output, while the last waiter added 25 meals served to total output. In order to maximize the number of meals served with a fixed budget, the manager should…

    • 3237 Words
    • 21 Pages
    Satisfactory Essays
  • Good Essays

    Problem 1

    • 638 Words
    • 3 Pages

    20-1-A. The pricing method that the pizzeria is using shows they understand how marginal utility works, specifically diminishing marginal utility. After hitting the level of satisfaction from the first pizza, a second pizza will not be quite as rewarding. Getting an additional pizza at a price of only $5 dollars will entice a customer to purchase it because of the lower price. Because the significance of the second pizza is less than the first, a costumer would spend less on it.…

    • 638 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Subhash

    • 1183 Words
    • 5 Pages

    1. Assume that the price of pizza is $2.00 per slice. The marginal cost of the 3rd slice of pizza is:…

    • 1183 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    To apply the stored-program concept, central processing unit (CPUs) are designed to recognize instructions encoded as bit patterns. This collection of instructions along with the encoding system is called the machine language. An instruction expressed in this language is called a machine-level instruction or, more commonly, a machine instruction.…

    • 458 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    The following information will introduce general knowledge in basic programming concepts. It shall discuss basic types of computer programming languages as-well-as program development. There are three basic types of computer programming languages that will be discussed in a simple and easy to understand manner. We shall also describe the program development cycle and discuss why it is important to use a structured and organized process to create a computer programming language.…

    • 1318 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    Copyright © 2012 Pearson Education, Inc. 0-5 Terminology • Machine instruction: An instruction (or command) encoded as a bit pattern d) d d tt recognizable by the CPU • Machine language: The set of all instructions recognized by a machine Copyright © 2012 Pearson Education, Inc. 0-6 3 Machine Language Philosophies • Reduced Instruction Set Computing (RISC) – Few, simple, efficient, and fast instructions – Examples: PowerPC from Apple/IBM/Motorola and ARM • Complex Instruction Set Computing (CISC) –…

    • 783 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    12. John and 2 friends are going out for pizza for lunch. They split one pizza and 3 large drinks. The pizza cost $12.00.…

    • 882 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Most programming languages—such as C, C++, and Fortran—use compilers, but some—such as BASIC and LISP—use interpreters. An interpreter analyzes and executes each line of source code one-by-one. Interpreters produce initial results faster than compilers, but the source code must be re-interpreted with every use and interpreted languages are usually not as sophisticated as compiled languages.…

    • 4020 Words
    • 17 Pages
    Powerful Essays
  • Good Essays

    Compiler and Interpreter

    • 1182 Words
    • 4 Pages

    Before the Java and C# programming languages appeared, computer programs were only compiled or interpreted. Languages like Assembly Language, C, C++, Fortran, Pascal were almost always compiled into machine code. Languages like Basic,VbScript and JavaScript were usually interpreted.…

    • 1182 Words
    • 4 Pages
    Good Essays