Free Essay

Programming Assignment 1

In:

Submitted By isis0315
Words 1417
Pages 6
ASSIGNMENT 1
COMP-202, Fall 2014, All Sections Due: September 19th , 2014 (23:59)

Please read the entire pdf before starting. You must do this assignment individually and, unless otherwise specified, you must follow all the general instructions and regulations for assignments. Graders have the discretion to deduct up to 10% of the value of this assignment for deviations from the general instructions and regulations. These regulations are posted on the course website. Be sure to read them before starting. Question 1: Question 2: Question 3: 60 points 20 points 20 points 100 points total

It is very important that you follow the directions as closely as possible. The directions, while perhaps tedious, are designed to make it as easy as possible for the TAs to mark the assignments by letting them run your assignment through automated tests. While these tests will not determine your entire grade, it will speed up the process significantly, which will allow the TAs to provide better feedback and not waste time on administrative details. Plus, if the TA is in a good mood while he or she is grading, then that increases the chance of them giving out partial marks. Marks can be removed if comments are missing, if the code is not well structured, or if your solution does not follow the assignment specifications.

Assignment
Question 1: Scratch Project (60 points) You are to head to http://scratch.mit.edu/ and create an account. Start by exploring some projects, and click on the see inside button in order to understand the logic behind each project. Feel free to make any changes to the scripts to see how it affects the overall behaviour of the program. Once you can honestly say to yourself, “Okay, I think I get this,” you are ready to proceed. Now it is time to choose your own adventure! Your mission is, quite simply, to have fun with Scratch and implement a project of your choice (be it an animation, a game, interactive art, or anything else), subject only to the following requirements. • Your project must have at least two sprites, at least one of which must resemble something other than a cat. • Your project must have at least three scripts total (i.e., not necessarily three per sprite). • Your project must use at least one condition, one loop, and one variable. • Your project must use at least one sound. • Your project should be more complex than most of those demonstrated in lecture (many of which, though instructive, were quite short) but it can be less complex than, say, Scratch Scratch Revolution. As such, your project should probably use a few dozen puzzle pieces overall.

1

Feel free to peruse additional projects online for inspiration, but your own project should not be terribly similar to any of them. Try to think of an idea on your own, and then set out to implement it. But do not try to implement the entirety of your project all at once: pluck off one piece at a time. It is important to take your time and break overall task into sub and simpler tasks. If, along the way, you find it too difficult to implement some feature, try not to fret; alter your design or work around the problem. If you set out to implement an idea that you find fun, you should not find it hard to satisfy this assignment requirements. Once finished with your project, click See project page in Scratch’s top-right corner. Ensure your project has a title (in Scratch’s top-left corner), some detailed instructions (in Scratch’s top-right corner), and some notes and/or credits (in Scratch’s bottom-right corner). Then click Share in Scratch’s topright corner so that others like your TA can see your project. Finally, take note of the URL in your browser’s address bar. That’s your project’s URL on MIT’s website, and you will need to send it to us in the Question1.txt file you will create. Oh, and if you would like to exhibit your project in Fall 2014’s gallery, head to http://scratch.mit. edu/studios/517481/projects/, then click Add projects, and paste in your own project’s URL. Moreover, if you would like to participate to the Fall 2014 Scratch contest, where you get to vote as well as participating, please submit that same URL to the course’s subreddit, http://www.reddit.com/r/ comp202/. The three most upvoted1 projects will be given McGill goodies, e.g. t-shirt, key-chain, pen, bag, etc. The grand winner will also receive an additional prize. Question 2: Simple Java Program (20 points) You are to write your very first marked Java piece of code. The program will ask the user to input the number of laws of robotics according to Isaac Asimov. This is achievable using the Scanner object as seen in class. You will have to save the String input into a variable in order to output back the answer. Your program should output the following: Hal: How many laws of robotics are they according to Isaac Asimov? 2 < ----- Input by the user Hal: Indeed they are 2 laws of robotics. In order to produce this output you will need at least three instructions. One instruction to print the sentence to ask for a number, although it could be a letter. One instruction to save that information in a String variable. One instruction to print the sentence Hal: Indeed they are **String variable** laws of robotics. BONUS (5 points) - Use an if statement that will check if the number of laws is three. In the case it is true you should output the following “Hal: You got it right. Three indeed.”. You should use the method String.equals(String). In the case the user did not entered the right number, you have to mentioned it and then recite the three laws of robotics, which you will have to find. Question 3: Binary and Logic (20 points) Please write your answer in the Question3.txt file. Each line is an answer to a question, if you do not know the answer leave that line blank. In other words, the first line refers to line 1 of the text file, line 2 refers to the question 2, and so on. Each question is 5 points each. a. What is 28 in binary2 ? b. What is 11010 in base 103 ? c. What does the following logical expression evaluate to? (False or False) and (True and (not False))
1 Downvotes 2 Where

will not count 28 is a base ten number 3 Where 11010 is a base two number

Page 2

d. Let a and b be boolean variables. Is it possible to set values for a and b to have the following expression evaluate as False? a or (((not b) or (not b)) or (b or (not a)))

What To Submit
You have to submit one zip file with all your files in it to MyCourses under Assignment 1. If you do not know how to zip files, please ask any search engine or friends. Google might be your best friend with this, and a lot of different little problems as well. Question1.txt Question2.java Question3.txt Scratch URL The complete java code to run the code One line for each answer

Confession.txt (optional) In this file, you can tell the TA about any issues you ran into doing this assignment. If you point out an error that you know occurs in your problem, it may lead the TA to give you more partial credit. On the other hand, it also may lead the TA to notice something that otherwise he or she would not.

Marking Scheme
Up to 30% of question 2 points can be removed from bad indentation of your code as well as omitting comments, or missing files. Marks will be removed as well if the class names are not respected. Question 1 Two sprites Three distinct scripts The project runs The project is well explained and titled Has a least one if, loop and one variable 10 10 10 10 20 60 points points points points points points

Question 2 Get the input of the user Some comments and right indentation Displays the right dialogue Use if-else to check if “3” is entered 10 5 5 5 20 points points points bonus points points

Question 3 a. b. c. d. 5 5 5 5 20 points points points points points

Page 3

Similar Documents

Premium Essay

Nt1310 Unit 1 Programming Assignment

...Programming assignment unit 6 #### Task Description You are entrusted with fostering a product application for a vehicle rental organization that handles various sorts of vehicles: vehicles, bikes, and trucks. To guarantee consistency and authorize normal behavior among these vehicle types, you'll use connection points and classes. Developers will find the assignment to be engaging and interactive due to its modular structure. #### Prerequisites: 1. **Plan and carry out a connection point named 'Vehicle'** that incorporates strategies for recovering the vehicle's make, model, and year of production. 2. What is the difference between a'smart' and a'smart'? **Foster a class named 'Car'** that carries out the 'Vehicle' and 'CarVehicle' interfaces....

Words: 1070 - Pages: 5

Premium Essay

Nt1310 Unit 1 Programming Assignment

...My first programming assignment was exciting. I declared the variables and assigned them easily. The calculation and displaying the result for this assignment was straightforward. I captured the essence of converting requirements to code. I see the value of adding comments to my code. It helps me organize the steps in the process and ultimately the functions in the code for reuse. I learned that having meaningful variable names is important to the process. Since each variable is a data container, it is critical that the identifier is properly labeled to perform calculations and interactions with a user. As an example, if a variable stores a user's home address, I need to make sure that I am displaying the user's home address in the verification process. If the address variable is not named properly, I may display a variable that is not relevant and or cause significant overhead to troubleshoot issues....

Words: 510 - Pages: 3

Premium Essay

Intro to Programming Unit 1 Research Assignment

...Unit 1 research assignment 1 1970’s 1) Pascal, Creator, Niklaus Wirth. The specific motivation behind this language was to encourage good programming practice using structured programming and data structuring. 2) SQL (Structured Query Language) designed by, Donald D. Chamberlin, and Raymond F. Boyce. The motivation behind this language was designed for managing data held in a relational database management system. ( RDBMS) 3) C, Designed by Dennis Ritchie. the motivation behind this language is structured programming and allows lexical variable scope and recursion. 4) Applesoft BASIC, developed by Marc McDonald, and Ric Weiland. The motivation with this language was it was designed to be backwards-compatible with integer BASIC and used the core of Microsoft’s 6502 BASIC implementation. 5) GRASS, Developed by Thomas A. DeFanti. GRASS is similar to BASIC in sytax, but added numerous instructions for specifying 2D object animation, including scaling, translation, rotation and color changes over time. 1980’s 1) BASICA, Designed by Thomas E. Kurtz. Designed to offer support for the graphics and sound hardware of the IBM PC line. 2) Turbo Pascal, developed by Borland, under Philippe Kahn’s leadership. This is a software development system that includes a compiler and an integrated development environment for the Pascal programming language. 3) C++, designed by Bjarne Stroustrup. This is a general purpose programming language that is free-form...

Words: 677 - Pages: 3

Premium Essay

Unit 1 Research Assignment 1: Exploring Programming Languages

...Unit 1 Research Assignment 1: Exploring Programming Languages NT1420 In the late 1960’s Simula was invented by Nygaard and Dahl as a superset of Algol 60, this was the first language designed to support object-oriented programming. Then between 1969 and 1973 C was developed by Dennis Ritchie and Ken Thompson at Bell Labs. Smalltalk was created in the mid 1970’s that provided a complete ground-up design of an object-oriented language, and about the same time Prolog was designed in 1972 by Colmerauer, Roussel, and Kowalski, this was the first logic programming language. In 1973 Robin Milner built two polymorphic type systems (ML and Lisp) which were used in pioneering statically typed functional programming languages. Now going to the 80’s, Ada was created in 1983 by a team ran by Jean Ichbiah which was designed for built-in language support for explicit concurrency, offering tasks, synchronous message passing, protected objects, and non-determinism. Erlang was developed by Joe Armstrong in 1986 that supports hot swapping, so that code can be changed without stopping a system. In 1985 Eiffel was created as an ISO-standardized, object-oriented programming language designed by Bertrand Meyer. The program emphasizes declarative statements over procedural code and attempts to eliminate the need for bookkeeping instructions. TCL is a scripting language created by John Ousterhout in 1988 which is used for rapid prototyping, scripted applications, GUIs and testing. Perl was developed...

Words: 583 - Pages: 3

Premium Essay

Unit 1 Research Assignment 1: Exploring Programming Language

...Unit 1 Research Assignment 1: Exploring Programming Language Structured Query Language (SQL) is a specialized language for updating, deleting, and requesting information from databases. SQL is an ANSI and ISO standard, and is the de facto database query language. A variety of established database products support SQL, including products from Oracle and Microsoft SQL Server. It is widely used in both industry and academia, often for enormous, complex datbases. (Base, 2013). SQL was developed in the 1970’s by IBM to initially manipulate and retrieve data in IBM system R. The SQL language was standardized in 1986 by the American National Standards Institute (ANSI); however, later releases were released as International Organization Standardization (ISO) standards. (Inc., 2013) Although IBM authored SQL, the first SQL implementation was provided by Oracle Corporation (then called Relational Software Inc.). Early commercial implementations were concentrated on midsized UNIX-based DBMSs, such as Oracle, Ingres, and Informix. IBM followed in 1981 with SQL/DS, the forerunner to DB2, which debuted in 1983. (Unknown, 2010) ANSI published the first SQL standard (SQL-86) in 1986. An international version of the standard issued by ISO appeared in 1987. A significant update to SQL-86 was released in 1989 (SQL-89). Virtually, all relational DBMSs that you encounter today support most of the 1986 standard. (Unknown, 2010) In 1992, the standard was revised again (SQL-92), adding...

Words: 803 - Pages: 4

Premium Essay

Unit 1 Research Assignment 1: Exploring Programming Languages

...John Medina PT2520T Database Concepts Mr. Collier Unit 1 Research Assignment 1: Exploring Programming Languages History of the SQL – SQL was initially developed at IBM by Donald D. Chamberlain, Donald C. Messerly, and Raymond F. Boyce in the early 1970s. This version, initially called SEQUEL (Structured English Query Language) was designed to manipulate and retrieve data stored in IBM’s original quasi-relational database management system, System R, which a group at IBM San Jose Research Laboratory had developed during the 1970s. The acronym SEQUEL was later changed to SQL because “SEQUEL” was a trademark of the UK-based Hawker Siddely aircraft company. In the late 1970s, Relational Software Inc. (now Oracle Corporation) saw the potential of the concepts described by Codd, Chamberlain, and Boyce and developed their own SQL-based RDBMS with aspirations of selling it to the U.S. Navy, Central Intelligence Agency, and other U.S. government agencies. In June 1979, Relational Software Inc. introduced the first commercially available implementation of SQL, Oracle V2(Version 2) for VAX computers. After testing SQL at customer test sites to determine the usefulness and practicality of the system. IBM began developing commercial products based on their System R prototype including System/38, SQL/DS, and DB2, which were commercially available in 1979, 1981, and 1983 respectively. According to the paragraph above, there had to have been 4 revisions to the SQL. The most recent version...

Words: 565 - Pages: 3

Free Essay

Pt1420 Programming Unit 1 Research Assignment

...1970’s CLU is a programming language created at MIT by Barbara Liskov and her students between 1974 and 1975. It was notable for its use of constructors for abstract data types that included the code that operated on them, a key step in the direction of object-oriented programming (OOP). Euclid is an imperative programming language for writing verifiable programs. It was designed by Butler Lampson and associates at the Xerox PARC lab in the mid-1970s. The implementation was led by Ric Holt at the University of Toronto and James Cordy was the principal programmer for the first implementation of the compiler. It was originally designed for the Motorola 6809 microprocessor. Forth is an imperative stack-based computer programming language and programming environment. Language features include structured programming, reflection (the ability to modify the program structure during program execution), concatenative programming (functions are composed with juxtaposition) and extensibility (the programmer can create new commands). Although not an acronym, the language's name is sometimes spelled with all capital letters as FORTH, following the customary usage during its earlier years. Forth was designed by Charles H. Moore and appeared in the 1970’s. GRASS is the original version of GRASS was developed by Tom DeFanti for his 1974 Ohio State University Ph.D. thesis. It was developed on a PDP-11/45 driving a Vector General 3DR display, and as the name implies, this was a purely vector...

Words: 1885 - Pages: 8

Free Essay

Bmis 208 Bmis208 Bmis/208 Programming Assignment 1

...BMIS/208 Programming Assignment 1 http://helpido.com/bmis-208-programming-assignment-1/ BMIS 208 BMIS208 BMIS/208 Programming Assignment 2 http://helpido.com/bmis-208-week-2-programming-assignment-2/ BMIS 208 BMIS208 BMIS/208 Programming Assignment 3 http://helpido.com/bmis-208-week-3-write-a-visual-basic-2010-program-to-analyze-a-mortgage-the-user/ BMIS 208 BMIS208 BMIS/208 Programming Assignment 4 http://helpido.com/bmis-208-week-4-a-furniture-manufacturer-makes-two-types-of-furniture-chairs-and/ BMIS 208 BMIS208 BMIS/208 Programming Assignment 5 http://helpido.com/bmis-208-programming-assignment-5/#5 BMIS 208 BMIS208 BMIS/208 Programming Assignment 5 (NEW VERSION) http://helpido.com/bmis-208-programming-assignment-5-new-version/ BMIS 208 BMIS208 BMIS/208 Programming Assignment 6 http://helpido.com/bmis-208-week-6-the-figures-below-show-the-output-of-a-visual-basic-program-that/ BMIS 208 BMIS208 BMIS/208 Programming Assignment 6 (NEW VERSION) http://helpido.com/bmis-208-programming-assignment-6/ BMIS 208 BMIS208 BMIS/208 Programming Assignment 7 http://helpido.com/bmis-208-programming-assignment-7/ BMIS 208 BMIS208 BMIS/208 Programming Assignment 7 (NEW VERSION) http://helpido.com/bmis-208-programming-assignment-7-new/ BMIS 208 BMIS208 BMIS/208 Programming Assignment 7 (Another NEW VERSION) http://helpido.com/bmis-208-programming-assignment-7-telephone/ ...

Words: 362 - Pages: 2

Premium Essay

Unit 1 Research Assignment 1: Exploring Programming Languages

...Structured Query Language (SQL) is a specialized language for updating, deleting, and requesting information from databases. SQL is an American National Standards Institute (ANSI) and International Standards Institute (ISO) standard. A variety of established database products support SQL, including products from Oracle and Microsoft SQL Server. It is widely used in both industry and academia, often for enormous, complex databases. (Base, 2013). SQL was developed in the 1970’s by IBM to initially manipulate and retrieve data in IBM system R. The SQL language was standardized in 1986 by the ANSI; it later had releases that were released as ISO standards. IBM authored SQL and the first SQL implementation was provided by Oracle Corporation. Early commercial implementations were concentrated on midsized UNIX-based DBMSs, such as Oracle, Ingres, and Informix. IBM followed in 1981 with SQL/DS, the forerunner to DB2, which debuted in 1983. ANSI published the first SQL standard (SQL-86) in 1986. An international version of the standard issued by ISO appeared in 1987. A significant update to SQL-86 was released in 1989 (SQL-89). Virtually, all relational DBMSs that you encounter today support most of the 1986 standard. In 1992, the standard was revised again (SQL-92), adding more capabilities to the language. Because SQL-92 was s superset of SQL-89, older database application programs ran under the new standard with minimal modifications. Until October 1996, DBMS vendors could submit...

Words: 269 - Pages: 2

Premium Essay

Home Page » Computers and Technology Pt1420 Unit 1 in: Computers and Technology Pt1420 Unit 1 “Unit 1 Assignment 1” Itt Technical Institute Intro to Programming – Pt1420 Unit 1 Assignment 1 Short Answer Questions 1.

...Home Page » Computers and Technology Pt1420 Unit 1 In: Computers and Technology Pt1420 Unit 1 “Unit 1 Assignment 1” ITT Technical Institute Intro to Programming – PT1420 Unit 1 Assignment 1 Short Answer Questions 1. Why is the CPU the most important component in a computer? The reason the CPU is the most important component in a computer is because without the CPU you can’t run any software. 2. What number does a bit that is turned on represent? What number does a bit that is turned off represent? The number in a bit that represents a turned on position is 1. The number in a bit that represents a turned off position is 0. 3. What would call a device that works with binary data? A digital device is a device that works with binary data. 4. What are the words that make up a high-level programming language called? Keywords or Reserved Words are words that make up a high-level programming language. 5. What are short words that are used in assembly language called? Mnemonics are short words that are used in assembly language. 6. What is the difference between a compiler and an interpreter? The difference between a compiler and an interpreter is that a compiler translates high-level language into separate machine language program while an interpreter translates AND executes the instructions in a high-level language program. 7. What type of software controls the internal operations of the computer’s hardware? An operating...

Words: 393 - Pages: 2

Premium Essay

Doc 1

...[pic] |Quantitative Methods – MAT 540 | |Student Course Guide | |Prerequisite: MAT 300 | |INSTRUCTIONAL MATERIAL – Required | |( including all mandatory software) | |Taylor, B. M. (2010). Introduction to management science (10th ed.). Upper Saddle River, NJ: Pearson/Prentice Hall. | |Treeplan add-on for Excel. This software is available in the Open Lab at Strayer campuses, and can also be downloaded from the textbook's | |companion Website. http://wps.prenhall.com/bp_taylor_introms_10/112/28870/7390752.cw/-/7390754/index.html | | | |COURSE DESCRIPTION | |Applies quantitative methods to systems management...

Words: 2976 - Pages: 12

Free Essay

Computers

...Programming Assignment 1 (Submit by Sunday of Week 6) Preliminary Steps 1. Invoke Visual Basic by following the directions in section 2.2, pp. 20– 23. 2. Perform the text box, button, label, and list box walkthroughs, pp. 23– 30. 3. Perform the event procedure walkthrough, pp. 38–43. Programming Exercises Do the following exercises from An Introduction to Programming Using Visual Basic 2010. a. Exercise no. 70, p. 67 b. Exercise no. 40, p. 82 To submit your assignment, first create a ZIP file of the application folder for each exercise (see “Appendix: A Note on Submitting Programming Assignments” at the end of the syllabus). Then upload and submit both ZIP files (compressed folders) to the assignment link provided in the Assignments area of the course Web site. S-18 ASSIGNMENT MODULE 5 Learning Objectives After successfully completing this assignment, you should be able to:  Write programs in Visual Basic 2010 while being guided by the six steps of the program development cycle: analyze the problem, design a solution, choose the interface, write code, test and debug your solution, and document your code.  Incorporate input and output methods, including reading data from sequential files, obtaining user input to input boxes, and displaying boxes, and displaying messages in message boxes. Study Assignment Assigned Reading  Read chapter 3, section 3.3, in An Introduction to Programming Using Visual Basic 2010, 8th ed., by Schneider.  Read the...

Words: 660 - Pages: 3

Free Essay

Prg 211 Entire Class Computer Programming

...PRG 211 ENTIRE CLASS COMPUTER PROGRAMMING To Purchase this tutorial visit following link http://wiseamerican.us/product/prg-211-entire-class-computer-programming/ Contact us at: SUPPORT@WISEAMERICAN.US PRG 211 ENTIRE CLASS COMPUTER PROGRAMMING PRG 211 Complete Class Algorithms and Logic for Computer Programming WEEK 1 PRG 211 Week 1 Programming Fundamentals -Reusability of Code Discussion Question 1 Discussion Question 2 WEEK 2 PRG 211 Week 2 Program Solution Proposal Discussion Question 1 Discussion Question 2 WEEK 3 PRG 211 Week 3 Selection Structure Visual Logic Flowchart.vls PRG 211 Week 3 Selection Structure paper /800 words Discussion Question 1 Discussion Question 2 WEEK 4 PRG 211 Week 4 Array Structure Proposal Visual Logic Flowchart PRG 211 Week 4 Individual Assignment – Array Structure Proposal Discussion Question 1 Discussion Question 2 WEEK 5 Calorie Management Visual logic Flowchart Final Team Assignment – Calorie Management Paper /1500 Word Final Team Assignment – Calorie Management Presentation Discussion Question 1 Discussion Question 2 PRG 211 ENTIRE CLASS COMPUTER PROGRAMMING PRG 211 Complete Class Algorithms and Logic for Computer Programming WEEK 1 PRG 211 Week 1 Programming Fundamentals -Reusability of Code Discussion Question 1 Discussion Question 2 WEEK 2 PRG 211 Week 2 Program Solution Proposal Discussion Question 1 Discussion Question 2 WEEK 3 PRG 211 Week 3 Selection Structure Visual Logic Flowchart...

Words: 287 - Pages: 2

Premium Essay

Principles of Management

...Computer Programming 1 4 units (3 hours lecture with 3 hours laboratory per week) This course introduces the students to the fundamentals of logic formulation together with their implementation in the C++ Programming language. This course should serve as a foundation for students in the Computer Science, Information Technology, and Computer Technology Program. None BSIT/BSCS/ACT Prerequisite: Department/Program: GENERAL OBJECTIVES: At the end of this course, the students should be able to: 1. 2. 3. 4. 5. 6. To learn the components in problem solving Explore the strategies in problem solving in relation to procedural programming Analyze problems Design algorithms to solve problems Implement algorithms in a programming language Test programming solutions to problems Preliminary Grading Period Time Table Specific Objectives 1stand 2ndWeek Introduction in Programming Learn how to analyze and design a program To understand the basic of Programming Topic Algorithms Programming Language Levels Steps in writing a Program Programming Techniques  Pseudocode  Flowchart Teaching-Learning Strategies Lecture with Hands-On Exercises Tools/Aid Blackboard Handouts Multimedia Presentation Evaluation Assignment Recitation Seatwork Quizzes Machine Problem or Case Study 3rdWeek Introducing C++ Determine how C++ originate Remarks about Programming Study the aspect of Programming The Origin of C++ Know how to construct a Simple Input, Output and Assignment program using...

Words: 952 - Pages: 4

Free Essay

A Paper

... | | |Information Systems & Technology | | |PRG/211 Version 4 | | |Algorithms and Logic for Computer Programming | Copyright © 2012, 2011, 2010 by University of Phoenix. All rights reserved. Course Description This course provides students with a basic understanding of programming development practices. Concepts covered include the application of algorithms and logic to the design and development of procedural and object oriented computer programs to address the problem solving requirements associated with business information systems. This course will cover procedural programming concepts including data types, controls structures, functional decomposition, arrays, and files, classes and objects. Policies Faculty and students/learners will be held responsible for understanding and adhering to all policies contained within the following two documents: • University policies: You must be logged into the student website to view this document. • Instructor policies: This document is posted in the Course Materials forum. University policies are...

Words: 1735 - Pages: 7