View the step-by-step solution to:

Arab Open University Faculty of Computer Studies M150 Data, computing and information M150A TMA01 - Fall 2013/2014 Cut-off date: 14-Dec-13 Total...

Question 4 [20 marks]
1. a. Write JavaScript program to calculate area and volume of a cube. The program
should work according to the following specifications: [6]
− Read the edge length of a cube.
− Calculate the area and volume of the cube using the following formulas:
Area = 6 *(edge length)2
volume = (edge length)3
− Print the edge length, area and volume in the output window.
b. Run your program with two different values of edge length. In your Solution
document insert two screenshots showing the different resulted output.
2. a. Using nested if-else statement, write JavaScript program that works according
to the following specifications: [14]
– Ask the user if he wants to buy a "pc" or a "laptop". Read the answer
from the user and store it in a variable.
– If the user selected a "laptop" then ask the user to select which color he
wants "white" or "black". Read the answer from the user and store it in a
variable.
– Calculate the price of the user selection as follows:
- PC: 1700$.
- Black laptop: 2500$.
- White laptop: 3000$.
– Give the following discount on the price and calculate the discounted
price as follows:
- PC: 20%.
- Black laptop: 15%.
- White laptop: 10%.
– Print the user selection, price and discounted price in the output window.
– Assume that all strings used in the program and entered by a user are in
small letters.
b. Test your program and run it to make sure it works properly. In your Solution
document insert three screenshots for the output:
– One showing the case when the user selected to buy a PC.
– One showing the case when the user selected to buy a black laptop.
– One showing the case when the user selected to buy a white laptop.
Important note: In your answers to question4, you should follow good
programming style that helps readability. This includes:

Page 1 / 4 M150A TMA01 – Fall 2013/2014 Cut-off date: 14-Dec-13 Total marks: 80 This TMA should be submitted to your tutor electronically through the LMS system before the cut-off date indicated above. You should write your solutions to the questions in a single word document. Head the document with your name and your Personal Identifier (ID). This TMA assesses your understanding of Units 1, 2, 3, 6 and section 2 and 3 of unit 7. It is marked out of 80, out of which 20% will be considered for the continuous assessment grade. It consists of 4 questions. The total marks for each question are shown at the beginning of each question. The marks allocated to each part of a question are indicated in the margin. Important notes: - Before you start working with this assignment, you need to refer to section 8.2 of the M150 course companion to read about plagiarism and how to avoid it. This will help you in getting high grade in this TMA. Arab Open University Faculty of Computer Studies M150 Data, computing and information
Background image of page 1
Page 2 / 4 Question 1 [20 marks] 1. Read section 8.2 of the M150 course companion (You should have had a copy of it with the course material and you can also view a soft copy of it in the course CD ROM 1). a. Briefly define the term plagiarism. [2] b. How can you avoid plagiarism when writing your TMAs? [2] 2. Explain the difference between the Internet and the Web. [4] 3. Define a search engine. Give examples on two search engines you use. [4] 4. Representations play a central role in facilitating communication by establishing a relationship between some form and some meaningful content subject to some convention; mention the two conditions for effective representation. [4] 5. From your understanding of the term “complex representation”, briefly explain why traffic signs are considered to be complex representations? Explain the advantage of complex representations using the traffic signs as an example. [4] Question 2 [20 marks] 1. Any feature of the analogue world can be taken inside the boundary of the computer using two-steps process. Mentions the two steps with brief explanation giving an example that illustrates the steps. [6] 2. Show all the steps required to convert the binary value 111000101 to its decimal representation. [4] 3. Show all the steps required to convert the decimal value 1980 to its octal representation. [4] 4. Consider an image of size 1000 X 720 pixels which requires 2160000 bytes to be stored inside the computer. Find the number of bits used to represent each pixel, the pixel amplitude and the coloring system used for the image. [6] Question 3 [20 marks] 1. What is the function of the following: [3] a. Control Unit. b. Main Memory. c. Compiler. 2. Use truth tables to show whether the following two Boolean expressions are equivalent or not. [6] NOT (A AND NOT B) NOT A OR B
Background image of page 2
Show entire document

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question