I WANT YOU TO SOLVE 2 QUESTION ONLY

Description

I WANT YOU TO SOLVE THE THRID AND FOURTH QUESTION ONLY

Don't use plagiarized sources. Get Your Custom Assignment on
I WANT YOU TO SOLVE 2 QUESTION ONLY
From as Little as $13/Page

Unformatted Attachment Preview

Homework #2
Due Date: Mar 09 2024
Submission Instructions:
Submit your assignment on the blackboard link, corresponding to your Section:
Please follow the following rules when sending the source code:
1) The name of the file should be q#_myID_section.cpp (for e.g: q1_u000002046_51.cpp)
2) In case two assignments are found to be similar, both students will get ZERO.’
Objectives:



Basic practice on arithmetic operations.
Basic practice on control structures (repetition and selection).
Basic practice on input/output files.
Exercise
Out of
1
2
2
3
3
2
4
3
Mark
Integrity Statement: Read carefully!
Strict directives have been given to the assistants who will be marking this homework to follow the
University’s policy on cheating. Any student caught cheating in any form will be given zero (0) the first
time. (We will not get into the issue of who copied from whom!!!). If such an act reoccurs, the case will be
sent to the University Student Discipline Committee.
Chapter 5: Loop Structures
Problem1:
Let = −1 −2 … 1 0 be an integer and = 0 − 1 + 2 − ⋯ + (−1) . It is known that is
evenly divisible by 11 if and only if is evenly divisible by 11.
For example, suppose that n = 8784204. Then, t = 4 – 0 + 2 – 4 + 8 – 7 + 8 = 11. Because 11 is divisible by 11,
it follows that 8784204 is divisible by 11.
If n =54063297, then t = 7 – 9 + 2 – 3 + 6 – 0 + 4 – 5 = 2. Because 2 is not divisible by 11, 54063297 is not
divisible by 11.
Write a C++ program that prompts the user to enter a positive integer and then uses this criterion to
determine whether the number is evenly divisible by 11.
1
Input /Output Samples:
Problem 2
Write a C++ program to prompt the user to enter an integer number greater than 1, then find the last
prime number that occurs before the entered number.
Input /Output Sample:
2
Chapter 3: Input/Output
Problem 3 Temperature
Write a C++ program that reads daily temperature data for a Sample output:
month and calculates the average temperature for each day
and the overall temperature of the month. The program should
read the data for the entire month from a file named
temperatures.txt (given). Assume the month has 30 days. The
input file contains one line for each day, where each line has 4
temperature readings (in degrees Celsius) for that day,
separated by spaces. Adjust decimal placed as per the below
sample output.
temeratures.txt content:
Problem 4: Bank Account Report Generator
You are given a text file named accounts.txt containing accounts.txt content:
information about several customers’ bank accounts. Each line
in the file represents a single customer’s account details with
the following format:
AccountID FirstName LastName InitialBalance
Write a C++ program that reads this file and then performs a
series of operations on each account based on another input transaction.txt content:
file named transactions.txt. This file contains a series of
transactions to be applied to the accounts, formatted as
follows:
AccountID TransactionType Amount
Where TransactionType is either D for deposit or W for
withdrawal. See sample content of transactions.txt file.
After processing all transactions, the program should generate report.txt content:
an output report named report.txt that lists the final balance of
each account, including the account ID, the customer’s name,
and the final balance, formatted like the original input. Check
sample output. All input files are given.
3

Purchase answer to see full
attachment