









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 A A A A A A A A A B B B B B B B B B C C C C C C C C C D D D D D D D D D E E E E E E E E E F F F F F F F F F G G G G G G G G G H H H H H H H H H I I I I I I I I I J J J J J J J J J K K K K K K K K K L L L L L L L L L M M M M M M M M M N N N N N N N N N O O O O O O O O O P P P P P P P P P Q Q Q Q Q Q Q Q Q R R R R R R R R R S S S S S S S S S T T T T T T T T T U U U U U U U U U V V V V V V V V V W W W W W W W W W X X X X X X X X X Y Y Y Y Y Y Y Y Y Z Z Z Z Z Z Z Z Z ↑ Print your Prism username in the spaces provided, and shade the boxes of the corresponding numbers and/or letters. I hereby signify that this examination paper contains my own work exclusively, and I have neither given nor received inappropriate help during the taking of this examination, in compliance with the letter and spirit of the Academic Honor Code of Georgia Tech. Name (print): GT ID# 9 0 ___ ___ ___ ___ ___ ___ ___ Signature: TA / Section: ____________________________ Prob. Poss. Pts Earned Pts Lost Pts by (cover) - - 1 30 2 25 3 25 4 20 TOTAL 100 Please Note: Failure to complete this front sheet correctly will cost you 5% of your grade. Please turn off (or silence) and put away any cell phones, beepers/pagers, personal radios or music players that you have in your possession Good Luck!
Academic misconduct (including - but not limited to - examples on the list below) could result in a zero score on this examination, an “F” final grade in the course, and/or other disciplinary action:
The following is a piece of MATLAB code produces the rotation about x-axis for the function z(x) = x^2. The function rotates 180 degrees. However, the code below contains errors in five lines. Find all the errors and correct them on the answer sheet. *_ There might be more than one error in a line.
1- error ____________________________________________________________ 2- error ____________________________________________________________ 3- error ____________________________________________________________ 4- error ____________________________________________________________ 7- error ____________________________________________________________ 8- error ____________________________________________________________ 9- error ____________________________________________________________ 10- error ____________________________________________________________
You are the manager of a warehouse. The warehouse just had a big sale in the past three days. Your employees gave you an excel spreadsheet that contains the numbers of items sold each day in the format as seen below. You want to know how much each item had been sold in the past three days. Write a MATLAB function which modifies the spreadsheet and creates a new excel file containing only the total amount had been sold for each item. Also, rename your new file with “New” in front of your original file name. For example, if your original file name is “Sale.xls”, the new file name should be “NewSale.xls” _The list may not necessarily contain five items._* function ThreeDaySale(xlsfile) %% Your code goes here... Your original file looks like: Day 1 Day 2 Day Item1 32 12 67 Item2 0 12 3 item3 12 12 76 item4 23 12 56 item5 0 12 0 Your new file looks like: Total Item1 111 Item2 15 item3 100 item4 91 item5 12
Q1. Imagine you were responsible for teaching a friend, who knew nothing about programming, about variables.
Q6 if 1 fprintf('Bulldogs drool\n'); else fprintf('Go Jackets!\n'); end if 2 fprintf('Bulldogs drool\n'); else fprintf('Go Jackets!\n'); end Write code fragments to fill in blanks 1 and 2 such that the output is: Bulldogs drool Go Jackets! Each of the code fragments must use both of the values ‘true’ and ‘false’ and must contain two or more of the following logical operators:
Q7. Imagine you were responsible for teaching a friend, who knew nothing about programming, about the if statement.
Q10 for i = 1 : 10 fprintf('Number %d\n', i); end In your own words, explain what the computer does when it executes the code above. Q11 n = 5; sum = 0; for i = 1 : n for j = 0 : (i - 1) sum = sum + j; end end What are the values of i, j, and sum after the code above executes?
Q12 n = 4; for 1 for 2 fprintf('%d', 3); end fprintf('!\n'); end Write code fragments to fill in blanks 1, 2, and 3 to complete the code above such that the output is: 1! 22! 333! 4444! Q13 Imagine you were responsible for teaching a friend, who knew nothing about programming, about while loops.
This page intentionally left blank for any extra work.