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

    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

    Week 3 Assignment

    • 497 Words
    • 2 Pages

    b What number of workers appears to be most efficient in terms of pizza product 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

    4) Joe is willing to pay $4 for his first slice of pizza and $3 for his second slice of pizza. If the market…

    • 3766 Words
    • 16 Pages
    Good 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
  • 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
  • Good Essays

    Computer Concepts Exercises

    • 2338 Words
    • 10 Pages

    011000 The list of codes for a microprocessor’s instruction set is called machine language. (Answer: True)…

    • 2338 Words
    • 10 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
  • Powerful Essays

    Compiler, in computer science, computer program that translates source code, instructions in a program written by a software engineer, into object code, those same instructions written in a language the computer 's central processing unit (CPU) can read and interpret. Software engineers write source code using high level programming languages that people can understand. Computers cannot directly execute source code, but need a compiler to translate these instructions into a low level language called machine code.…

    • 4020 Words
    • 17 Pages
    Powerful Essays
  • Better Essays

    I will examine the different generations of programming languages and discuss basic facts about each. I will also discuss the Fifth Generation Language, which some individuals may or may not agree exists.…

    • 948 Words
    • 3 Pages
    Better Essays
  • Good Essays

    Compiler and Interpreter

    • 1182 Words
    • 4 Pages

    Definition: Machine code is the name for the Instructions that a CPU can execute. It's rather difficult to read as it is just numbers in memory. There are programs that can convert the numbers back into assembly language but unless you are pretty skilled or trying to break a protection scheme, there is little use or need for it.…

    • 1182 Words
    • 4 Pages
    Good Essays