CMPSCI_105_Midterm_Exam_Solution

CMPSCI_105_Midterm_Exam_Solution - CMPSCI 105 Midterm Exam...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CMPSCI 105 Midterm Exam Solution – Spring 2007 – Professor William T. Verts CMPSCI 105 Midterm Exam Solution Spring 2007 March 30, 2007 Professor William T. Verts CMPSCI 105 Midterm Exam Solution – Spring 2007 – Professor William T. Verts GENERAL KNOWLEDGE <1> 10 Points – Fill in your answer into the box at the left side of each question. Show your work on the back of a page if you want us to consider partial credit. False False False True or False: A 3½-inch diskette is a “hard disk”. True or False: A USB flash drive is a “hard disk”. True or False: The number π (3.1415926…) can be represented in a finite number of computer memory bits as its true value, not as an approximation. True True or False: The square root of 2 (1.414213562…) is an irrational number (not a ratio of two integers). True True or False: Two hexadecimal digits exactly fit into eight binary bits. (I.e., do both represent the same number of distinct numeric values?) 32 What is the decimal value of the digit W if we are using base 36 arithmetic? 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 83 Convert the binary (base 2) number 10100112 into decimal (base 10). 1×26 + 0×25 + 1×24 + 0×23 + 0×22 + 1×21 + 1×20 = 64+0+16+0+0+2+1 53 Convert the binary (base 2) number 10100112 into hexadecimal (base 16) using the bit-partitioning method. 0101 = 5, 0011 = 3 10110001 What is the sum in binary (base 2) of the two binary numbers 10100112 and 10111102? 1021 Convert the decimal (base 10) number 3410 into trinary (base 3). 1×33 + 0×32 + 2×31 + 1×30 = 1×27 + 0×9 + 2×3 + 1×1 = 27+0+6+1 = 34. <2> 6 Points – I want to create a background color for my Web page where the decimal value of the red component is 255, the decimal value of the green component is 20, and the decimal value of the blue component is 240. Approximately what color will be shown on screen? Fill in the blank below with the appropriate HTML hexadecimal color code: Red = 25510 = FF16 Green = 2010 = 1416 Blue = 24010 = F016 High Red, Low Green, and High Blue = Purple/Magenta/Fuchsia/etc. <BODY BGCOLOR="#FF14F0"> <3> 4 Points – Trace the following gate circuit and show its output for all combinations of input values. Page 1 of 7 CMPSCI 105 Midterm Exam Solution – Spring 2007 – Professor William T. Verts UNIX & THE INTERNET <4> 6 Points – Fill in the blanks below with the correct, complete HTML codes to finish the Web page as follows: 1. 2. 3. 4. 5. The page title should be My Spiffy Web Page The page background should be a tiled image using the file Froggy.gif The Welcome! message must be centered on the screen and use an H1 heading The hyperlink should be to the site www.ibm.com The clickable image should use the file BigFrog.jpg <HTML> <HEAD> <TITLE>My Spiffy Web Page</TITLE> </HEAD> <BODY BACKGROUND="Froggy.gif"> <CENTER><H1>Welcome!</H1></CENTER> <A HREF="http://www.ibm.com"> <IMG SRC="BigFrog.jpg"> </A> </BODY> </HTML> <5> 6 Points – Assume for each of the following problems that the UNIX file BigFrog.jpg has permissions rw------x (i.e., the problems are independent of one another, and the result of one does not depend on any other answers). What are the permissions on the file after each of the following chmod commands are executed? 1. rw----rw- 2. chmod a+r BigFrog.jpg rw-r--r-x 3. <6> chmod 606 BigFrog.jpg chmod 444 BigFrog.jpg r--r--r-- 2 Points – Short Answer – What are the differences between Notepad and emacs? Notepad is a Windows program, runs under graphical interface rules (mouse, menus, etc.). Emacs is a UNIX program, runs under keyboard commands only, and you must be telnet-connected to a UNIX computer to run it. Page 2 of 7 CMPSCI 105 Midterm Exam Solution – Spring 2007 – Professor William T. Verts <7> 2 Points – Short Answer – Why do we now use a program such as PuTTY instead of traditional telnet programs? PuTTY, etc., encrypt their communications so packet sniffers cannot read intercepted messages. Traditional telnets don’t encrypt their communications. <8> 3 Points – Once logged into an Internet site using UNIX ftp, what are the three commands that allow us to explore that remote site? dir (or ls) cd pwd <9> 2 Points – In downloading a big file from the Internet I have a choice between two mirror sites in the same time zone that I am in. 1. If I can wait a little while, when is the best time for me to do the download? Late night, when traffic is likely to be low. 2. If I cannot wait, which site should I pick (what factors influence my decision)? Closest physical site with fewer hops (less likely to encounter traffic). <10> 4 Points – I have a number of images that I want to put on the Web, but unfortunately they are all in the 24-bit-per-pixel .BMP format. In each case below, tell me if I should convert the image to .GIF format, to .JPG format, or if I should leave it as a .BMP file. 1. The image is a photograph containing thousands of different colors. 2. The image is a photograph containing fewer than 200 colors. 3. The image is line-art containing only two colors, black and white. .GIF 4. The image is a cartoon containing a couple dozen colors. .GIF .JPG .GIF/.JPG If you are putting images on the Web then .BMP is never a valid choice. <11> 5 Points – Short Answer – An image in a .BMP file is a combination of black and white line-art and a photograph containing thousands of colors. Why is it a bad idea to convert the image to either .GIF or .JPG format? What happens to the image in each case if I do? Is there a better, alternative format, which gets around the deficiencies of both the .GIF and .JPG formats and still lets me put the image on the Web? .GIF loses colors because the format is limited to a maximum of 256 colors, .JPG “fuzzes out” the line-art due to lossy compression, .PNG supports millions of colors and has lossless compression. Page 3 of 7 CMPSCI 105 Midterm Exam Solution – Spring 2007 – Professor William T. Verts MICROSOFT WINDOWS & ACCESSORIES <12> 2 Points – In any Windows program, what does it mean when a menu entry is gray? The menu entry is inactive and cannot be used (or it doesn’t make sense to use the menu entry in the current context). <13> 2 Points – If I left-click-drag a file from the Windows desktop to my flash drive, will the file be moved or copied? Copied – The desktop is on drive C: and the flash drive is a different drive letter. <14> 2 Points – Short Answer – Why should I use .ZIP archives to distribute files on the Web? The contents of a .ZIP file are compressed, and .ZIP files allow multiple files to be stored inside (so one download gets everything and goes faster than with multiple uncompressed files). <15> 2 Points – I’ve downloaded an .EXE program from the Web. What should I do before running it? Scan it for viruses. <16> 5 Points – The following diagram shows Bézier curve #1 as I might draw it in Windows Paint, along with its endpoints and control points. Draw Bézier curve #2 so that it blends smoothly into Bézier curve #1. The endpoints and one of the control points for Bézier #2 are given to you; as part of your answer you will need to indicate on your drawing where to place Control 1 (any legal placement for Control 1 is OK). Control 1 must be in-line with End 1 and the corresponding control point from Bézier #1, and the new curve leaves End 1 tangent to the control line. Page 4 of 7 CMPSCI 105 Midterm Exam Solution – Spring 2007 – Professor William T. Verts WORD PROCESSING <17> 3 Points – In the text sample shown here: ONE WAY – EXIT ONLY 1. Point out all places where kerning can be used to reduce unnatural-looking white space. Kerning happens between the WA, AY, and LY pairs only. 2. Point out examples of serifs. Any of the little spikes on the tips and ends of the letters. 3. Each word is ½ inch from the ascender line to the descender line. What is the point size of that text? ½ inch × 72 points/inch = 36 points. <18> 5 Points – Short Answer – I have designed a new named style in Microsoft Word to have several desired attributes, including specific typeface, line spacing, indentation, and other settings, and I apply that style to all the paragraphs in my document. What happens to my document when I change the definition(s) in that style? All paragraphs are updates automatically to reflect the new style definitions. <19> 5 Points – Short Answer – Why might I save a document as .PDF (Adobe Acrobat) format? 1. To distribute documents in a form that anyone can read/view in the way it should appear on the printer (regardless of the word processor used to create it, and Acrobat Reader is free). 2. To protect intellectual property by password protecting the document – you can allow reading/printing but can forbid text extraction/modification. Page 5 of 7 CMPSCI 105 Midterm Exam Solution – Spring 2007 – Professor William T. Verts SPREADSHEETS <20> 10 Points – Here is a spreadsheet containing exam records for students in a small class. 1. (1 point) Write below a single, efficient formula designed to go into cell C13 which computes the count of students who took Exam 1. Structure your formula so that it can be copied into cell D13 to give the appropriate value for Exam 2. =COUNT(C4:C11) 2. (1 point) Write below a single, efficient formula designed to go into cell C14 which computes the average score for Exam 1. Structure your formula so that it can be copied into cell D14 to give the appropriate value for Exam 2. =AVERAGE(C4:C11) or 3. =SUM(C4:C11)/COUNT(C4:C11) (1 point) Write below a single, efficient formula designed to go into cell C15 which shows the highest score for Exam 1. Structure your formula so that it can be copied into cell D15 to give the appropriate value for Exam 2. =MAX(C4:C11) 4. (1 point) Write below a single, efficient formula designed to go into cell C16 which shows the lowest score for Exam 1. Structure your formula so that it can be copied into cell D16 to give the appropriate value for Exam 2. =MIN(C4:C11) 5. (3 points) On the spreadsheet above, write into cells C13, C15, C16, D13, D15, and D16 the expected computed answers for the corresponding formulae (you are not required to compute the averages for the cells in row 14). Page 6 of 7 CMPSCI 105 Midterm Exam Solution – Spring 2007 – Professor William T. Verts 6. (3 points) I next click on the AutoFilter button on column C (Exam 1) and select 68 from the drop-down list. What are the names of the students who will still be shown afterwards? Fred and Sue <21> 5 Points – Here is the same table as before, this time with the AutoFilter removed and the data selected for sorting. Show the result of the sort in the following image (write your answers in cells B4:D11). <22> 4 Points – The formula =NOW() returns the internal date number 39171 for March 30, 2007. For the formula =NOW()+16 what is the internal date number that is computed and what is the calendar date shown on screen? 39187 = April 15, 2007 Page 7 of 7 CMPSCI 105 Midterm Exam Solution – Spring 2007 – Professor William T. Verts <23> 5 Points – Cell AB9 contains the following formula which is then copied to cell X15. What is the resulting formula in cell X15 after the copy has been completed? =Z12+(14*$W$20)-AC8+$M14 =V18+(14*$W$20)-Y14+$M20 Page 8 of 7 ...
View Full Document

This note was uploaded on 12/13/2009 for the course MATH 100 taught by Professor Rudivalis during the Spring '08 term at UMass (Amherst).

Ask a homework question - tutors are online