Quiz1_Practice_InterestCalc
.pdf
keyboard_arrow_up
School
New York University *
*We aren’t endorsed by this school
Course
UB23
Subject
Computer Science
Date
Jan 9, 2024
Type
Pages
2
Uploaded by MasterPuppy901
Name: __________________________
Intro to Programming & Data Science (TECH.UB.23)
QUIZ 1, PART 2 (50/100 points)
PRACTICE QUESTION
This section of the midterm consists of a program you need to write using the IDLE text editor
and shell.
You can use your textbook, slides, notes and any online resources for this section.
Please hand this sheet back (with your name filled out) to the TA after you have completed
the exam.
Submit your final script (as a .py file named LName_Fname_Quiz1.py) through
the Brightspace
portal under “
Quiz1
”
in Assignments.
Partial credit will be given.
Please be
sure to make sure your submission went through ok on the Assignments portal.
You must
submit your program by the end of class.
Any late entries may not be counted.
Context:
You are working with a non-profit that is trying to educate young people to save.
You want to show them the power of compounding interest (how your money starts earning
money after a while).
To show them how much more their money can be worth by investing
in a CD or Treasury, you are asked to write a program as specified below.
Compounding Interest:
In order to calculate compound interest, you need to multiply the
value of the year before with the interest rate.
For example, the value in year 1 is: principal *
(1 + rate).
The value in year 2 is the value in year 1 * (1 + rate).
Requirements:
Create a program that meets the following criteria:
-
Asks the user to enter a principal or starting amount (call this variable
“
principal
”
),
enter the interest rate they expect to earn (call this variable “rate”), and ask the user
how many years they would
like to invest for (call this variable “years”).
-
Create a function called opening that prints
the title of the program, “The Compound
Interest Calculator”)
-
Create a function called “calculate” that calculates the value in each year (call this
“final”
) using the principal, rate and years variables.
This function should also prints
the value that the user will have at the given interest rate for each year and return the
final value as an output of the function as the variable “final”.
-
Create a functi
on called “closing” that prints a closing statement using the final value,
e.g. “The final value of your investment is nnn.”
-
Nest all your request for input and operations within a main function.
If the program is
run, the main function should run.
TURN THE PAGE FOR A VISUALIZATION OF THE CONSOLE & SOME TIPS
_____________________________________________
The Compound Interest Calculator
Enter principal: 5000
Enter the interest rate: 4.67
Enter number of years: 5
Year 1: 5233.5
Year 2: 5477.9
Year 3: 5733.72
Year 4: 6001.48
Year 5: 6281.75
Thanks for using this program! The final value of your investment is:
6281.75
___________________________________________
Be sure to make sure your text, spacing, breaks and number formats look exactly like
the sample above.
Partial credit will be given even if you aren’t able to get the program to
run, don’t incl
ude the main function or c
an’t get the program
to loop.
GOOD LUCK!
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
Related Questions
Test Analyze Tools Extensions Window Help Search (Ctrl+Q)
Debug Any CPU
Start
File Edit
View
Git Project
Build Debug
2-2
Program.cs* + X
C# Models.cs
I
85
I
}
Model = model;
Year = year;
Status = status; // status
Notes = notes;
89
90
93
94
68 a # 6 8 bo 63 6$་མཁའ་མ8ར8མཚོ ་བའི་་ཝཱ
CarRentalCompany.ProgramA
//public bool avaialble { get; private set; }
O references
public static List CarRent (List rentedVehcile)
{// if the car is available, add to a List that says rented
return rentedvehcile.Where(v => Car.status).ToList();
95
96
97
98
99
}
100
O references
public void CarReturn()
if i
101
{
82%
Output
Show output from: Build
1
Main(string[] args)
Developer PowerShell Package Manager Console Error List Command Window Code Definition Window Output Test Results Test Runs
Ready
81°
myhp
CarRentalCompany
zm
W
Truck.cs
+
Sign in &
Ln: 172
Ch: 6
SPC
CRLF
Qx
Solution Explorer
Live Share
Search Solution Explorer (Ctrl+;) >
Solution 'CarRentalCompany' (1
C# Models.cs
Properties
C*…
arrow_forward
Lesson: Visual BasicTopic: Data Files
arrow_forward
PYTHON PROGRAMMING ONLY PLEASE
I am doing a patient portal/record keeping system i already have the layout need help writing the code.
Here is my layout below
Menu:
View personal information
Update personal information
View medical history
Update medical history
Exit
DECISION BLOCKS
View personal information:
View patient personal information( Name, Date of Birth, Address, Phone Number)
Press Console: "You have chosen to view your personal information."
Update personal information:
Ask the patient to update personal information
Update the patient personal information
Print to the console: "You have chosen to update your personal information."
View historical medical information:
View patient medical history (medical history, surgery, medications, allergies, etc.)
Prints to console: "You have chosen to view your medical history."
Update medical history:
Prompt patient to enter updated medical information
Update the patient's medical history
Print to the console: "You have…
arrow_forward
Don’t copy / paste from google must be original app
Your task is to design, develop a application basic Your program must be original, user
friendly and efficient.
Requirements:
Your program must be done in C++ or Ps.JS;
arrow_forward
Object
Addr code
Symbol
Mnemon Operand
Comment
Which of the following are true for the above code?
The code contains local variables
ASRA is a unary Pep/9 instruction
examl and exam2 are used to store integers
STBA sends a decinmal value to memory location FC15
.BLOCK will generate code
arrow_forward
Computer Science
Can someone help me make a coding for what's below, I need a coding that will allow a user to input a word and it will be google searched? (C# Programming Language)
• Open a Google search results page for a word entered within the prototype application.
arrow_forward
Lesson: Visual BasicTopic: Data Files
arrow_forward
When you cut or copy information it gets place in the___________
arrow_forward
C# programming
• Create a text file outside of C#• Read each record (name) from the file and• Append today’s date to a line from the text file and write to asecondary text file
arrow_forward
Java Programming Language
DSA
Don't use built in libraries.
We want to build an address book that is capable of storing name, address & phone number ofa person. Address book provides functionality in the form of a menu. The feature list includes:• Add – to add a new person record• Delete – to delete an existing person record by name• Search – to search a person record by name· Exit – to exit from application
arrow_forward
USC (PAG) Personal Academic Guide ™ is your personal electronic sequence sheet. This is a simple application to keep track of each course you are doing/have done, serve as a personal exam timetable for the course which have final exams, keep track of your projects for courses with projects and keep a record of grades earned. It should also allow you to write notes for each course you have done. The concept is like a check sheet system blended with a simple exam timetable.
Create a Class Diagram of at least six (6) major entities for your application. For entities with a large number of attributes you are allowed to limit your attributes to a max of six (6). All operations within each class should be identified by their visibility
arrow_forward
ment basic file input/output methods
To verify, test, and debug any errors in the code
Module learning outcomes assessed by this coursework:
On successful completion of this assignment, students will be expected, at threshold level, to be able
LO # 5: Software development environments (editor, interpreter, debugger), and programmi
using Python programming language.
Task:
Students are required to
create
a Python program that performs customized Caesa
encryption/decryption, as follows:
A- The program should have a main menu, through which the user can choose whether he wants
to encrypt a text or decrypt it.
B- If the user chose to encrypt plaintext, he will be asked to enter his ID, which is also the name
of the input file (i.e. if student ID is 199999, then the input file name should be 199999.txt).
The user should not enter the file extension (i.e. .txt), instead, the program should append
the extension to the ID automatically.
C- The input file must contain the following information:…
arrow_forward
Debugging Exercise 1-4 ï¼^C#i¼%o
The provided file has syntax and/or logical
Determine the problem and fix the program.
errors.
arrow_forward
Lesson: Visual BasicTopic: Data Files
arrow_forward
Python programming
you are tasked to create a program that accepts two numbers anddisplays the sum. You’ll be creating three versions of the program. Consider different ways of structuring your code to accomplish the program requirements.
Write your answers in a Word document in a tabular form. Sample format below
arrow_forward
Design "Shopping List "windows application that allows the user to
open, save , edit , or format text files.
Your program should include the following menu items:
File
Edit
Format
New
Cut
Font
Open
Copy
Color
Save
Paste
Exit
Select all
Day and Time
need C# language
arrow_forward
The basic goal of computer process is to convert data into __________.
information
tables
files
graphs
arrow_forward
With Visual Basic for Applications, what are the steps I need to take to open a file?
arrow_forward
cmd quation
arrow_forward
2 The basic goal of computer process is to convert data into __________.
a) information
b) tables
c) files
d) graphs
arrow_forward
Choose True or False for all the following
arrow_forward
Data can be ________.
arrow_forward
Can anyone please help me with these? thank you in advance
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Fundamentals of Information Systems
Computer Science
ISBN:9781305082168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Microsoft Windows 10 Comprehensive 2019
Computer Science
ISBN:9780357392607
Author:FREUND
Publisher:Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Related Questions
- Test Analyze Tools Extensions Window Help Search (Ctrl+Q) Debug Any CPU Start File Edit View Git Project Build Debug 2-2 Program.cs* + X C# Models.cs I 85 I } Model = model; Year = year; Status = status; // status Notes = notes; 89 90 93 94 68 a # 6 8 bo 63 6$་མཁའ་མ8ར8མཚོ ་བའི་་ཝཱ CarRentalCompany.ProgramA //public bool avaialble { get; private set; } O references public static List CarRent (List rentedVehcile) {// if the car is available, add to a List that says rented return rentedvehcile.Where(v => Car.status).ToList(); 95 96 97 98 99 } 100 O references public void CarReturn() if i 101 { 82% Output Show output from: Build 1 Main(string[] args) Developer PowerShell Package Manager Console Error List Command Window Code Definition Window Output Test Results Test Runs Ready 81° myhp CarRentalCompany zm W Truck.cs + Sign in & Ln: 172 Ch: 6 SPC CRLF Qx Solution Explorer Live Share Search Solution Explorer (Ctrl+;) > Solution 'CarRentalCompany' (1 C# Models.cs Properties C*…arrow_forwardLesson: Visual BasicTopic: Data Filesarrow_forwardPYTHON PROGRAMMING ONLY PLEASE I am doing a patient portal/record keeping system i already have the layout need help writing the code. Here is my layout below Menu: View personal information Update personal information View medical history Update medical history Exit DECISION BLOCKS View personal information: View patient personal information( Name, Date of Birth, Address, Phone Number) Press Console: "You have chosen to view your personal information." Update personal information: Ask the patient to update personal information Update the patient personal information Print to the console: "You have chosen to update your personal information." View historical medical information: View patient medical history (medical history, surgery, medications, allergies, etc.) Prints to console: "You have chosen to view your medical history." Update medical history: Prompt patient to enter updated medical information Update the patient's medical history Print to the console: "You have…arrow_forward
- Don’t copy / paste from google must be original app Your task is to design, develop a application basic Your program must be original, user friendly and efficient. Requirements: Your program must be done in C++ or Ps.JS;arrow_forwardObject Addr code Symbol Mnemon Operand Comment Which of the following are true for the above code? The code contains local variables ASRA is a unary Pep/9 instruction examl and exam2 are used to store integers STBA sends a decinmal value to memory location FC15 .BLOCK will generate codearrow_forwardComputer Science Can someone help me make a coding for what's below, I need a coding that will allow a user to input a word and it will be google searched? (C# Programming Language) • Open a Google search results page for a word entered within the prototype application.arrow_forward
- Lesson: Visual BasicTopic: Data Filesarrow_forwardWhen you cut or copy information it gets place in the___________arrow_forwardC# programming • Create a text file outside of C#• Read each record (name) from the file and• Append today’s date to a line from the text file and write to asecondary text filearrow_forward
- Java Programming Language DSA Don't use built in libraries. We want to build an address book that is capable of storing name, address & phone number ofa person. Address book provides functionality in the form of a menu. The feature list includes:• Add – to add a new person record• Delete – to delete an existing person record by name• Search – to search a person record by name· Exit – to exit from applicationarrow_forwardUSC (PAG) Personal Academic Guide ™ is your personal electronic sequence sheet. This is a simple application to keep track of each course you are doing/have done, serve as a personal exam timetable for the course which have final exams, keep track of your projects for courses with projects and keep a record of grades earned. It should also allow you to write notes for each course you have done. The concept is like a check sheet system blended with a simple exam timetable. Create a Class Diagram of at least six (6) major entities for your application. For entities with a large number of attributes you are allowed to limit your attributes to a max of six (6). All operations within each class should be identified by their visibilityarrow_forwardment basic file input/output methods To verify, test, and debug any errors in the code Module learning outcomes assessed by this coursework: On successful completion of this assignment, students will be expected, at threshold level, to be able LO # 5: Software development environments (editor, interpreter, debugger), and programmi using Python programming language. Task: Students are required to create a Python program that performs customized Caesa encryption/decryption, as follows: A- The program should have a main menu, through which the user can choose whether he wants to encrypt a text or decrypt it. B- If the user chose to encrypt plaintext, he will be asked to enter his ID, which is also the name of the input file (i.e. if student ID is 199999, then the input file name should be 199999.txt). The user should not enter the file extension (i.e. .txt), instead, the program should append the extension to the ID automatically. C- The input file must contain the following information:…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageFundamentals of Information SystemsComputer ScienceISBN:9781305082168Author:Ralph Stair, George ReynoldsPublisher:Cengage Learning
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningMicrosoft Windows 10 Comprehensive 2019Computer ScienceISBN:9780357392607Author:FREUNDPublisher:CengageCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Fundamentals of Information Systems
Computer Science
ISBN:9781305082168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Microsoft Windows 10 Comprehensive 2019
Computer Science
ISBN:9780357392607
Author:FREUND
Publisher:Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L