Alex Amado, HW4

pdf

School

Purdue University *

*We aren’t endorsed by this school

Course

10100

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

10

Uploaded by MinisterPartridge3587

Report
CS 10100 Homework 04 This is Question 1 on Page 1 CS 101 Homework 04 Due 11:59pm Thursday, 9/21 Delete nothing from this file. Edit this file to add your typewritten answers to each question. When your answer includes a diagram make sure that it is clear and large enough to read. Ensure that your answer fits on the same page as its question. If you change the pagination of this file or if your complete answer to a question does not fit on the page with that question, then you may receive a lower score. Export your completed Word file to PDF. Upload your PDF file to Gradescope.com. It is your responsibility to upload this assignment to its correct place in Gradescope. You may upload multiple times. Your final upload will be scored. Use the download capability to check your upload. Uploading will be blocked after the due time (plus grace period). Max score = 10 points; 1 point per question. The above directions apply for all assignments uploaded to Gradescope. Why should your answer be on the same page with its question? Answer: Gradescope has been programmed to expect that your PDF file will have exactly one question and your entire answer to it on one page. This allows Gradescope to automatically find and display your answers to the instructional team for scoring. HW04 Q1. In your own words, describe the steps to develop a computer program. The first step in developing a computer program is understanding what you want the program to do or understanding the problem. After you have determined and understood what the problem is, you can start planning out the code and designing the language. After you design the code, you can start actually coding the computer program. After you code the program, you can begin testing the program to make sure that it does what you wanted it to do, and then, if there are problems within the code, you can fix those and debug the program. Finally, after debugging the program (if needed), the program is fully developed and is ready for users to begin interacting with it.
CS 10100 Homework 04 This is Question 2 on Page 2 HW04 Q2. Go online and find an example a programming language a. designed to write web pages and write its name here ___HTML_________________ b. designed to write operating systems and write its name here _____C_________
CS 10100 Homework 04 This is Question 3 on Page 3 HW04 Q3. Watch the video: https://youtu.be/1OukpDfsuXE and answer a. What characteristic makes a programming language low level? Give two examples of low-level programming languages. Low-level languages are machine oriented and they require extensive knowledge of computer hardware and its configuration. Two levels are machine language and assembly language. b. What Characteristic makes a programming language high-level? Give two examples of high-level programming languages. High-level languages are programming languages that use English and mathematical symbols in its instructions. Two examples are Java and Python.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CS 10100 Homework 04 This is Question 4 on Page 4 HW04 Q4. How does an interpreted language differ from a compiled language in terms of execution speed and portability? Name two examples of interpreted languages. Interpreted languages immediately execute code line by line which allows for fast changes to the code, while compiled languages convert the whole code into instructions that are able to be read by the machine. Two examples of interpreted languages are Python and JavaScript.
CS 10100 Homework 04 This is Question 5 on Page 5 HW04 Q5. When a professional programmer is assigned a task, does this person immediately sit down at a computer keyboard and start typing code? Why? A programmer will usually not sit down and immediately start programming. Typing code is very complicated and takes many lines of precise code and wording in order to complete a given task. For moderate to advanced tasks, a programmer must first figure out the problem, think of how to fix it, and determine the code, and then start typing the code itself. If the task is much simpler, the programmer might be able to just start programming immediately.
CS 10100 Homework 04 This is Question 6 on Page 6 HW04 Q6. Solve this problem: Imagine you have a document of grades for all assignments and exams for each student in a class. Now Find out how many students got an A in the class (A cumulative grade above 80% is considered grade A) a. What are the inputs of this problem? The student data as well as the grading system b. What are the outputs of this problem? Number of students with a grade of an A c. Write an algorithm that would produce the output(s) from the input(s). You find the number of points each student got by adding up all the assignments and exams and divide them by the points, and if the number is over 80, you add a one to the number of students that got an A.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CS 10100 Homework 04 This is Question 7 on Page 7 HW04 Q7. What is the difference between indefinite iteration and definite iteration? Give an example of each that is not mentioned in the slides. And what is infinite iteration? Indefinite iteration is when the code executes itself until some condition is met, while definite iteration is when the number of times the code must execute is previously explicitly stated.
CS 10100 Homework 04 This is Question 8 on Page 8 HW04 Q8. Are there more than 20 coding languages? More than 100? 200 even? (Hint: Check out the List of Programming Languages article on Wikipedia.org). There are over 200 coding and programming languages according to the Wikipedia article, closer to 700 languages.
CS 10100 Homework 04 This is Question 9 on Page 9 HW04 Q9. Research current rates of monetary exchange. Follow the program development cycle to design a system that works as follows. Ask the user to enter an amount in units of dollars, then convert the amount to UK currency (pound sterling) and display the pound amount; then ask the user enter the next dollar amount, convert it to pounds and display the pound amount; repeat until the user enters “exit”, then exit the program. Describe your system design by writing its lines of code similar in style to examples from the lecture slides. Identify lines of code that create repetition or perform selection by placing a comment with that line labeling it as an instance of repetition or selection. userInput = input(“enter an amount in us dollars:”) while (userInput != “exit”): # indefinite repetition ukPounds = userInput • 0.80 print(ukPounds) userInput = input(“enter another amount in us dollars:”) exit()
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CS 10100 Homework 04 This is Question 10 on Page 10 HW04 Q10. Virtual assistants, such as Alexa and Siri, are programs that run on computers and accept speech input in certain of the human languages. These programs then, sometimes, output useful information or take a useful action. For example, speaking to Siri, “How many dollars is one Euro?” results, generally, in Siri speaking the current answer to this question and, if the device has a screen, displaying the written answer. Do you think a virtual assistant should be considered to be “a compiler for certain human languages?” Explain. I not really think that a virtual assistant should be considered a compiler for certain human languages because it is not compiling new code every time it takes an input, instead it is takes in inputs from the user, which is more similar interpreting.