CSC 148 Homework Assignment 1 (40pts) Topics covered: basic data types and arithmetic operations, input and print statement, conditional statement. Due Date: September 11 (Friday), 2020, end of the...

Finish the questions


CSC 148 Homework Assignment 1 (40pts) Topics covered: basic data types and arithmetic operations, input and print statement, conditional statement. Due Date: September 11 (Friday), 2020, end of the day (11:59 PM) Please read the instructions carefully! Late policy applies. Please read syllabus. Please DO NOT copy solutions from the Internet (changing variables or even copying segment of the code is very easy to be detected). If caught cheating, you will be reported to the Academic Integrity Counsel for (AIC) further actions. Please submit a zipped folder of all of the .py file (question 1 can be a text file) and upload to blackboard. Please name your question Question1_yourrlastname.py Failing to follow the instructions will cause reduced grade. Grading policy for each question: · 100% code runs correctly and is well commented. Every function has doctrine. Nice user interface. · 85% code runs correctly but no comments. User interface is not ideal. · 75% code seems to run but has output errors that can be easily fixed. · 50% code doesn’t run but significant code is written. · 0% no significant code is written. Q1. (5Pts) What is the difference between a compiled program and an interpreted program. Which will run faster and why? Which is easier to debug and why? Q2. (15 Pts) Write a program to get user's first name and age. The apply the following conditions and print the output accordingly: · If age is greater than 20 but less than 22, then print their name and square of their age · if the age is greater than 25 and less than 30 then print their name and square root of their age. · if age is greater than 35 then then concatenate their name and "American University" and print this. Q3, (5 Pts) Create a program that calculates the sum of even numbers smaller than 20. (5 pts) Hint: you could use a loop, but you also don’t have to. Q4, (5Pts). Write a function that takes a person’s name (string type) and an integer n as parameters and print “Hello, the person’s name” n times. Please call the function to output the result. In your program, assign n as a random integer between 1-10 and print out hello of the random times. Hint: import random e.g. multi_hello(“bei”, 2)-> hello, bei hello, bei Q5. (10 Pts) Write a program to ask user for an amount in foreign currency (Euro, and Japanese Yen) and convert it to US dollars and vice versa (if they entered US dollars, convert to their desired foreign currency). Ask the user the original currency and the desired conversion. E.g. Enter amount: 25.00 Enter currency: USD Enter desired currency: Euro Converted Amount: 20.33 Use floats to represent the amount.
Sep 09, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here