CPAN112_Lab05
.docx
keyboard_arrow_up
School
Humber College *
*We aren’t endorsed by this school
Course
112
Subject
Computer Science
Date
Feb 20, 2024
Type
docx
Pages
2
Uploaded by EarlPantherMaster1046
Fundamentals of Numeric Computing
CPAN 112
Lab 05
Please read the following instruction very carefully before
answering any questions:
Please read all the questions very carefully.
Please provide your answers in the boxes below each question, and
do not change the text colour.
Your answer MUST show the solution procedure. There is no
credit if you only state the final answer.
Please underline your final answer to each question.
Please keep the naming conventions requested in this lab and each
question.
Once you complete your lab, rename your word document file to
the (
CPAN112_LabXX_FirstName_LastName
). Replace XX
with the lab number (e.g. 01). Replace FirstName and LastName
with your first name and last name, respectively.
It will be a 10%
mark deduction if you do not follow the guidelines
mentioned above.
1) Determine m
, i
, and n
for the following: 8.1% compounded monthly for 15.5
years [20 Points]
2) A debt of $800 accumulates interest at 10% compounded semi-annually from
February 1, 2021, to August 1, 2023, and 11% compounded quarterly thereafter.
Determine the accumulated value of the debt on November 1, 2026. [20 Points]
3) Determine the sum of money that accumulates to $1600 at 5% compounded
quarterly in 6 years and 4 months. [20 Points]
4) Compute the discounted value of $7000 due in three years, five months if
money is worth 8% compounded quarterly. [20 Points]
5) A loan of $3000 borrowed today is to be repaid in three equal installments due
in one year, three years, and five years, respectively. What is the size of the equal
installments if money is worth 7 .2% compounded monthly? [20 Points]
Deliverables
:
The word document file (CPAN112_LabXX_FirstName_LastName) contains your
solution.
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
5. Using only the instructions shown in Figure 1-9, create an algorithm that shows the
steps an instructor takes when grading a test that contains 25 questions.
end if
end repeat
if the student's answer does not match the correct answer, do this:
mark the student's answer incorrect
read the student's answer and the correct answer
repeat 25 times:
arrow_forward
PYTHON PROGRAMMING!!
EXTRA CONSTRAINT: MAKE SURE THAT THE CODE ACCEPTS THE INPUT ON THE IMAGE AND OUTPUTS THE RESULT ON THE IMAGE AS WELLYou find yourself in a top-secret mission to infiltrate and disable the nuclear missile silos of a terrorist organization threatening to destroy any country that refuses to surrender. Fortunately, an ally double agent was able to successfully hijack the launch system used by the terrorists. However, in order to not get found out, they could not disable the system outright but they were able to infect the system with an undetectable virus that stops all processes of the system was activated.
Through a secure line, the double agent gives you the instructions in order to activate the virus and stop all missiles from firing:
In the trash can nearest the main computer, you should be able to get a crumpled piece of paper with a grid of random numbers printed onto it. You will know that it is the right piece of paper if there are the same number of rows and…
arrow_forward
Create C# (Sharp) code using visual studio:
Use Delegate methodology to do the following project:
Have a Add method, Subtract method, Multiply method, Divide method. Each method will loop 100 times. With each iteration, generate two random numbers (between 1 - 50), then perform the math operation (add for the Add method, subtract for the Subtract method, etc.). Make sure to display the numbers and the answer!
One validation check - for subtraction and division, make sure the higher number generated comes first in the calculation. For example, if 12 and 40 are the numbers generated, the math should be 40 -12 for the subtraction (not 12 - 40) and 40/12 for the division (not 12/40).
Again, make sure to use Delegates!
arrow_forward
A palindromic number (also known as a numeral palindrome or a numeric palindrome) is a number (such as 16461) that remains the same when its digits are reversed.
Create a flow chart of palindrome number.
arrow_forward
Part 6: Boolean Logic Expressions
Boolean expressions are types of logical operations that we can perform on true and false values. Note that the word Boolean is always capitalized because it was named after its inventor, George Boole. Boolean algebra is a very important topic in computer science, and if you haven't learned it before you definitely will in the future. However, for our purposes we are only interested in how we can use them to manipulate binary numbers. The way we use them on binary numbers is by treating 1 as true and 0 as false. From this point on I will be using 0 and 1 instead of false and true.
There are many types of Boolean expressions, but the three most important ones are AND, OR, and NOT.
AND takes 2 operands and will output 1 if they are both 1, or 0 otherwise
OR takes 2 operands and will output 1 if either one is 1, or 0 if neither is 1
NOT takes 1 operand and reverses it: 1 becomes 0, and 0 becomes 1
We can represent this behavior using something called a…
arrow_forward
11 Worksheet 5
Note:Solution using Matlab Code
Write a program that prompts the user to enter a number within the range of 1 through 7, those
numbers represent the weekdays as shown in the table. If the entered number is more than 7,
display 'invalid day'.
Number
1
2
3
4
5
6
7
Day
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Type of the day
Workday
Workday
Workday
Workday
Workday
Weekend
Weekend
The program should continue to repeat itself 10 times, after which, the program should stop.
Furthermore, the program should be able to show a message saying if this is a 'workday' or a
'weekend day'.
Note: you are required to add a comment beside your command. Hint: to add a comment you
may use the % sign. thank guys you dodo great.
arrow_forward
C++ Code
arrow_forward
What is the answer for this algorithm
arrow_forward
Traffic light control sequence flowchart
A typical traffic light control sequence for a 4 road junction has been described below (for a road system where the vehicles keep to their left while driving i.e. Australia, UK, South Africa etc).
The light changes as per the sequence listed below:
A. Before switch ON, all 4 roads should get ‘flashing yellow’ so as to enable them to look around and cross the road junction.
B. When switched ON, Main roads 1 & 3 should get green signals G1/G3 to go straight. This signal remains on for 30 seconds.
C. The above signals should be changed over to go right GR1/GR3 for 15 seconds only if any sensor S1/S3 of vehicles waiting to turn right is detected in the right turn lane . This will take place after a brief yellow signals Y1/Y3 in between.
D. In case no vehicle is waiting for right turn, the roads 1 & 3 should be closed with red signals R1/R3 and interim yellow signals Y1/Y3 for 2 seconds.
E. The above…
arrow_forward
Important instructions:
All programs must include introductory comments as well as comments all throughout the program. The introductory comment should include your name, the class name with section (e.g. CS 101 -24900), the program name, and a brief description of the program.
All Programs must also include pseudocode.
There are two parts to this question; the detailed pseudocode, and the program itself in C++
Write your program in C++ with Visual Studio, or an online compiler - compile, and execute it. Upload the file with the .ccp extension to Canvas for grading.
For visual studio users;
Don't forget to use the system ("pause") before the "return" statement at the end of your program.
Programming assignment 4:
Write a program that will convert U.S. dollar amounts to Phillippine peso and to euros, storing the conversion factors in the constants PESO_PER_DOLLAR and EUROS_PER_DOLLAR.
1 Dollar = 49.39 Philippine Peso
1 Dollar = 0.87 Euros
Format your currency amounts in…
arrow_forward
Design and write a Python program for exercise #19:
Please label your steps with comments (#) on your program
arrow_forward
Instructions
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.
An example of the program is shown below:
Enter an integer >> 13 Enter a second integer >> 24 Enter a third integer >> 101 The sum of 13 and 24 is 37 The sum of 24 and 101 is 125 The sum of 13 and 101 is 114 The difference between 13 and 24 is -11 The difference between 24 and 101 is -77 The difference between 13 and 101 is -88
Task 1: The DebugThree3 class compiles without error.
Task 2: The add() method adds two integers.
Task 3: The subtract() method subtracts two integers.
Task 4: The DebugThree2 program accepts user input and displays the correct output.
arrow_forward
Instructions
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.
An example of the program is shown below:
Enter an integer >> 13 Enter a second integer >> 24 Enter a third integer >> 101 The sum of 13 and 24 is 37 The sum of 24 and 101 is 125 The sum of 13 and 101 is 114 The difference between 13 and 24 is -11 The difference between 24 and 101 is -77 The difference between 13 and 101 is -88
Task 1: The DebugThree3 class compiles without error.
Task 2: The add() method adds two integers.
Task 3: The subtract() method subtracts two integers.
Task 4: The DebugThree2 program accepts user input and displays the correct output.
arrow_forward
Instructions
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.
An example of the program is shown below:
Enter credits for first student >> 18 Enter credits for second student >> 30 Total due for student #1 is $1365.1200000000001 Total due for student #2 is $2275.2000000000003
Task 1: The DebugThree4 class compiles without error.
Task 2: The computeTuitionBill() method computes and displays the correct tuition bill.
Task 3: The DebugThree4 program accepts user input and displays the correct output.
arrow_forward
Programming Language :- Python
arrow_forward
Digital Trumpet
Use an Arduino IDE to create a digital trumpet using Arduino Uno board the program should do the following (screenshot should be provided):
Program Overview
Check to see if the first button is pressed. a. If it is, play the frequency for c. b. If it isn’t, skip to the next else if statement.
Check to see if the second button is pressed. a. If it is, play the frequency for e. b. If it isn’t, skip to the next else if statement.
Check to see if the second button is pressed. a. If it is, play the frequency for g. b. If it isn’t, skip to the next else if statement.
If none of the if statements are true a. Turn the buzzer off.
arrow_forward
PROGRAMMING LANGUAGE: C++ALSO PASTE SCREENSHOTS OF OUTPUTS
You are required to create a simulation of an elevator system. There are 7 floors in a building. A user may enter the elevator and press the button of the destined floor. The simulation should display appropriate messages while moving towards the destined floor.
arrow_forward
What is the answer to this algorithm
arrow_forward
Convert the algorithm provided into C source code:
Each year, the county property tax system calculates and sends property tax bills to homeowners. Design a solution that allows the data entry clerk to enter property IDs and values into the system and displays the amount of tax due based on the tax rate of 3% . At the end of the program, display the total amount of potential tax revenue. To flag the end of the list of properties, enter the flag value of 0 when prompted for the property ID. Use a subfunction to calculate the amount of tax due on an individual property. Send the property value to the subfunction as an argument and return the amount of tax due.
arrow_forward
Q4
Based on Figure Q4, answer the following questions.
This program draws a triangle on the screen
My name is
My matric no is
I want to print triangle so wiii select no 1 = 1
Please enter 'y' to continue : y
Figure Q4
3
arrow_forward
Entered
Answer Preview
Result
Message
correct
(923,998)
(923,998)
(2398,2171)
(2398, 2171)
correct
(2,808)
(2,808)
Your answer isn't a number
incorrect
(it looks like a list of numbers)
At least one of the answers above is NOT correct.
(1 point) Consider the elliptic curve group based on the equation
y²
= x + ax + b
x3
mod p
where a =
2440, b = 295, and p
=
3391.
We will use these values as the parameters for a session of Elliptic Curve Diffie-Hellman Key Exchange. We
will use P = (2, 808) as a subgroup generator.
You may want to use mathematical software to help with the computations, such as the Sage Cell Server
(SCS).
On the SCS you can construct this group as:
G=Elliptic Curve (GF(3391), [2440,295])
Here is a working example.
(Note that the output on SCS is in the form of homogeneous coordinates. If you do not care about the details
simply ignore the 3rd coordinate of output.)
Alice selects the private key 18 and Bob selects the private key 15.
What is A, the public key of Alice?…
arrow_forward
Instructions
The program in the Programming Example: Fibonacci Number does not check:
Whether the first number entered by the user is less than or equal to the second number and whether both the numbers are nonnegative.
Whether the user entered a valid value for the position of the desired number in the Fibonacci sequence.
Rewrite that program so that it checks for these things.
NOTES:
If an invalid number is entered for case 1 above, prompt the user to enter both numbers again.
If an invalid number is entered for case 2, prompt the user to enter a value until a valid value is entered.
the code:
#include <iostream>
using namespace std;
int main()
{
//Declare variables
int previous1;
int previous2;
int current;
int counter;
int nthFibonacci;
cout << "Enter the first two Fibonacci numbers: "; //Step 1
cin >> previous1 >> previous2; //Step 2
cout << endl;
//verify the first two values
if(previous1<0 && previous2>0)…
arrow_forward
What is the answer for this algorithm
arrow_forward
Employee view attendance report
The employee must be logged in to the
system to perform this function. The
employee selects the report period (range
of dates: from - to). The employee selects
"show report". Range of dates for the
report must be maximum 3 months, so if
the range is invalid, the system displays an
error message. The system displays every
working day in the report with the status
of the employee in this day, which could
be one of the following: on time, late, did
not come.
One actor?
One use case name?
One class ?
Attributes for the class ?
One relation between classes ?
arrow_forward
Approximate time: 1 hour Please design an algorithm for each of the following problems. Express the algorithm in pseudocode. When writing in pseudocode, please be sure to indent for the processes and use spacing to make the pseudocode readable. The pseudocode must follow standards outlined in module 1. Please submit in Microsoft Word. Do not use Google Docs. The dealer’s cost of a car is 85% of the listed price. The dealer would accept any offer that is at least $500 over the dealer’s cost. Design an algorithm that prompts the user to input the list price of the car and print the least amount that the dealer would accept for the car. An ATM allows a customer to withdraw a maximum of $500 per day. If a customer withdraws more than $300, the service charge is 4% of the amount over $300. If the customer does not have sufficient money in the account, the ATM informs the customer about the insufficient funds and gives the customer the option to withdraw the money for a service…
arrow_forward
Steps for the code
Let's say you have a 5-digit number, 23456. You
are supposed to write a code that prints
numbers in the ones, tens, hundreds,
thousands, and ten thousands places of this
number. In the text box below, write the steps
you will follow to write the code. Share it on
the discussion forum. Here, you only need to
write the approach in a step-by-step manner,
just like you did with algorithm design in the
case of computational thinking.
arrow_forward
LABView
Draw by hand the diagram for a program that displays a count that increments 4 times per seconduntil the user pushes a stop button. Turn on a boolean light when the count is even. Thecount starts at 0 and goes until the user pushes the stop button.
arrow_forward
C language
The program should allow users to add, subtract, multiply, and divide fractions.
The program should display a menu and prompt the user for a mathematical operation, until they enter 5 to exit. The menu should give the user the option to add, subtract, multiply or divide fractions, or exit. After the user chooses their option, they should be prompted to input two fractions. The result of the arithmetic should then be displayed to the screen.
Requirements
main()Functionality: This main function should prompt the user for a menu option until they enter 5. If the user doesn't choose Option 5 to end the program, it should get two fractions from the user. It should decide, based on the menu option which actions to perform on the fractions. Option 1 adds the two fractions together. Option 2 subtracts the first fraction from the second. Option 3 multiplies the two fractions together. Option 4 divides the first fraction by the second one.
In addition to the main functions, your…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- 5. Using only the instructions shown in Figure 1-9, create an algorithm that shows the steps an instructor takes when grading a test that contains 25 questions. end if end repeat if the student's answer does not match the correct answer, do this: mark the student's answer incorrect read the student's answer and the correct answer repeat 25 times:arrow_forwardPYTHON PROGRAMMING!! EXTRA CONSTRAINT: MAKE SURE THAT THE CODE ACCEPTS THE INPUT ON THE IMAGE AND OUTPUTS THE RESULT ON THE IMAGE AS WELLYou find yourself in a top-secret mission to infiltrate and disable the nuclear missile silos of a terrorist organization threatening to destroy any country that refuses to surrender. Fortunately, an ally double agent was able to successfully hijack the launch system used by the terrorists. However, in order to not get found out, they could not disable the system outright but they were able to infect the system with an undetectable virus that stops all processes of the system was activated. Through a secure line, the double agent gives you the instructions in order to activate the virus and stop all missiles from firing: In the trash can nearest the main computer, you should be able to get a crumpled piece of paper with a grid of random numbers printed onto it. You will know that it is the right piece of paper if there are the same number of rows and…arrow_forwardCreate C# (Sharp) code using visual studio: Use Delegate methodology to do the following project: Have a Add method, Subtract method, Multiply method, Divide method. Each method will loop 100 times. With each iteration, generate two random numbers (between 1 - 50), then perform the math operation (add for the Add method, subtract for the Subtract method, etc.). Make sure to display the numbers and the answer! One validation check - for subtraction and division, make sure the higher number generated comes first in the calculation. For example, if 12 and 40 are the numbers generated, the math should be 40 -12 for the subtraction (not 12 - 40) and 40/12 for the division (not 12/40). Again, make sure to use Delegates!arrow_forward
- A palindromic number (also known as a numeral palindrome or a numeric palindrome) is a number (such as 16461) that remains the same when its digits are reversed. Create a flow chart of palindrome number.arrow_forwardPart 6: Boolean Logic Expressions Boolean expressions are types of logical operations that we can perform on true and false values. Note that the word Boolean is always capitalized because it was named after its inventor, George Boole. Boolean algebra is a very important topic in computer science, and if you haven't learned it before you definitely will in the future. However, for our purposes we are only interested in how we can use them to manipulate binary numbers. The way we use them on binary numbers is by treating 1 as true and 0 as false. From this point on I will be using 0 and 1 instead of false and true. There are many types of Boolean expressions, but the three most important ones are AND, OR, and NOT. AND takes 2 operands and will output 1 if they are both 1, or 0 otherwise OR takes 2 operands and will output 1 if either one is 1, or 0 if neither is 1 NOT takes 1 operand and reverses it: 1 becomes 0, and 0 becomes 1 We can represent this behavior using something called a…arrow_forward11 Worksheet 5 Note:Solution using Matlab Code Write a program that prompts the user to enter a number within the range of 1 through 7, those numbers represent the weekdays as shown in the table. If the entered number is more than 7, display 'invalid day'. Number 1 2 3 4 5 6 7 Day Sunday Monday Tuesday Wednesday Thursday Friday Saturday Type of the day Workday Workday Workday Workday Workday Weekend Weekend The program should continue to repeat itself 10 times, after which, the program should stop. Furthermore, the program should be able to show a message saying if this is a 'workday' or a 'weekend day'. Note: you are required to add a comment beside your command. Hint: to add a comment you may use the % sign. thank guys you dodo great.arrow_forward
- C++ Codearrow_forwardWhat is the answer for this algorithmarrow_forwardTraffic light control sequence flowchart A typical traffic light control sequence for a 4 road junction has been described below (for a road system where the vehicles keep to their left while driving i.e. Australia, UK, South Africa etc). The light changes as per the sequence listed below: A. Before switch ON, all 4 roads should get ‘flashing yellow’ so as to enable them to look around and cross the road junction. B. When switched ON, Main roads 1 & 3 should get green signals G1/G3 to go straight. This signal remains on for 30 seconds. C. The above signals should be changed over to go right GR1/GR3 for 15 seconds only if any sensor S1/S3 of vehicles waiting to turn right is detected in the right turn lane . This will take place after a brief yellow signals Y1/Y3 in between. D. In case no vehicle is waiting for right turn, the roads 1 & 3 should be closed with red signals R1/R3 and interim yellow signals Y1/Y3 for 2 seconds. E. The above…arrow_forward
- Important instructions: All programs must include introductory comments as well as comments all throughout the program. The introductory comment should include your name, the class name with section (e.g. CS 101 -24900), the program name, and a brief description of the program. All Programs must also include pseudocode. There are two parts to this question; the detailed pseudocode, and the program itself in C++ Write your program in C++ with Visual Studio, or an online compiler - compile, and execute it. Upload the file with the .ccp extension to Canvas for grading. For visual studio users; Don't forget to use the system ("pause") before the "return" statement at the end of your program. Programming assignment 4: Write a program that will convert U.S. dollar amounts to Phillippine peso and to euros, storing the conversion factors in the constants PESO_PER_DOLLAR and EUROS_PER_DOLLAR. 1 Dollar = 49.39 Philippine Peso 1 Dollar = 0.87 Euros Format your currency amounts in…arrow_forwardDesign and write a Python program for exercise #19: Please label your steps with comments (#) on your programarrow_forwardInstructions The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. An example of the program is shown below: Enter an integer >> 13 Enter a second integer >> 24 Enter a third integer >> 101 The sum of 13 and 24 is 37 The sum of 24 and 101 is 125 The sum of 13 and 101 is 114 The difference between 13 and 24 is -11 The difference between 24 and 101 is -77 The difference between 13 and 101 is -88 Task 1: The DebugThree3 class compiles without error. Task 2: The add() method adds two integers. Task 3: The subtract() method subtracts two integers. Task 4: The DebugThree2 program accepts user input and displays the correct output.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education