1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jek_recluse [69]
2 years ago
13

This is your chance to become the instructor. After learning the looping and input validation concepts, create a problem to give

to your students to allow them to practice the looping and input validation concepts. The problem should include at least two different decision structures and a loop. The number of times to process the loop is stated in the problem definition. The decision structures should be chosen from the simple, combined, nested and CASE structures. Use the Programming Exercise problems at the end of Chapter 5 as an example.
The problem description should include:

The input into the problem.

The output from the problem.

The generic processing necessary to solve the problem. (do not give too much information away).

The solution should include:

Input validation statements

The solution should include the exact calculations need to solve the problem.

The solution cannot be similar to a problem posted by another student, located on the Internet or located in another textbook.

pseudocode, in while loop
Computers and Technology
1 answer:
enot [183]2 years ago
4 0

Answer:

See Explaination

Explanation:

The Problem information is as follows:

The input: A data file containing the bank account information.Accounts are of different

types (like Savings Account, Checking Accounts).

The Output: Report on Number of Savings Account, Number of Checking accounts and their

total balances, avregae balance, maximum and minimum balance etc

Processing:

Read the file data

Consider valid account data

Separate different accounts

Calculate the sum of their balances

Calculate the average balnace for each type of account

Display the information

Solution:

1.The application should be able to read the csv file.

2.All the error checking should be done as per defined rules

3.The report should be generated in the defined format

4.Data display precisions need to be followed.

5.Interactive errors should be reported with proper messages

6.Integrity of the data should be maintaied while saving the data.

7. Calculation of the averageAccountBalance = (Sum of all the balances of a particular type of account)/(number of that type of account)

8. TotalAccountBalance = Sum of all the balances of each type of account.

9. To find maximum start with a default value and then traverse all the accounts and update the maximum value as per the comparison results

and same for minimum.

Input Validation:

1.Check for the filename (maximum length is 10 chars besides the csv extension)

2.account number (12 digits, first three entries are alphabets)

3.Name (Only alphabets are allowed)

4.Phone Number (7 digits must follow the format xxx-xxx-x)

pesudoCode:

Input filename

open the file

declare accounts[] array

Read the data in accounts and update numOfAccounts

declare numOfAccounts, numOfSavingActs, numOfCheckingActs, totalBalanceSavings, totalBalanceChecking, averageBalanceChecking

averageBalanceSavings, maximumSaavings, minimumSavings, maximumChecking, minimumChecking

for i = 1 to n:

if (Validate(account[i])):

if account[i].type == "Savings":

numOfSavingActs++

totalBalanceSavings = totalBalanceSavings + account[i].balance

if account[i].balance > maximumSavings:

maximumSavings = account[i].balance

if account[i].balance < minimumSavings:

minimumSavings = account[i].balance

if account[i].type == "Checkings":

numOfSavingActs++

totalBalanceSavings = totalBalanceSavings + account[i].balance

if account[i].balance > maximumSavings:

maximumSavings = account[i].balance

if account[i].balance < minimumSavings:

minimumSavings = account[i].balance

Display(Data)

You might be interested in
LEARNING TASK 3 about: REAMING THE RIGID STEEL CONDUIT.
devlian [24]

Answer:

1.I have learned that my teacher is a good teacher

2.I have realized that my name is beautiful

Explanation:

thats right? hope it's help you heart me and please give brainlesst

3 0
2 years ago
3.26 LAB: Leap Year A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate a
Tju [1.3M]

Answer:

year = int(input("Enter a year: "))

if (year % 4) == 0:

  if (year % 100) == 0:

      if (year % 400) == 0:

          print(str(year) + " - leap year")

      else:

          print(str(year) +" - not a leap year")

  else:

      print(str(year) + " - leap year")

else:

  print(str(year) + "- not a leap year")

Explanation:

*The code is in Python.

Ask the user to enter a year

Check if the <u>year mod 4</u> is 0 or not. If it is not 0, then the year is not a leap year. If it is 0 and if the <u>year mod 100</u> is not 0, then the year is a leap year. If the <u>year mod 100</u> is 0, also check if the <u>year mod 400</u> is 0 or not. If it is 0, then the year is a leap year. Otherwise, the year is not a leap year.

8 0
3 years ago
Read 2 more answers
In this lab, you complete a prewritten C++ program that calculates an employee’s productivity bonus and prints the employee’s na
Bas_tet [7]

Answer:

The answer to this question is given below in the explanation section

Explanation:

    The formula for productivity socre is      

 productivity score = ((transaction dollar value/no of transaction)/no of shift)

Productivity Score Bonus  is:  

<=30 $50

31–69 $75

70–199 $100

>= 200 $200

........................................................................................................................................

the code is given below

........................................................................................................................................

#include <iostream>

using namespace std;

int main()

{

   string firstName;

   string lastName;

   int noOfShift;

   int noOfTransaction;

   int transactionDollarValue;

   int productivityScore;

   int bonus;

   

   cout<<"Employee’s first name: ";

   cin>>firstName;

   cout<<"Employee's last name: ";

   cin>>lastName;

   cout<<"Number of shifts:";

   cin>>noOfShift;

   cout<<" Number of transactions: ";

   cin>>noOfTransaction;

   cout<<"Transaction dollar value:";

   cin>>transactionDollarValue;

   productivityScore = (transactionDollarValue/noOfTransaction)/noOfShift;

   

   if (productivityScore <= 30)

   {

       bonus =50;

       cout<<"Employee’s first name: "<<firstName<<" "<<lastName;

       cout<<endl;

       cout<<"Employee Bonuse: $"<<bonus;

       cout<<endl;

   }

   

   else if (productivityScore >= 79 && productivityScore <=199)

   

   {

       bonus =100;

       cout<<"Employee’s first name: "<<firstName<<" "<<lastName;

       cout<<"Employee Bonuse: $"<<bonus;

   }

   

   else if (productivityScore >= 200)

   

   {

       bonus =200;

       cout<<"Employee’s first name: "<<firstName<<" "<<lastName;

       cout<<"Employee Bonuse: $"<<bonus;

   }

   

   return 0;

}

               

       

6 0
3 years ago
What are the 4 main types of parking
erik [133]
Parallel parking, emergency parking, parking on a hill, and prohibited parking. at least that's what the handbook in Arizona says, but check with your state handbook.)
6 0
2 years ago
PGP encryption can be performed from the command line as well. What is the PGP command line syntax to encrypt the my-message.txt
Mrac [35]

Answer:

pgp --encrypt "my-message.txt" --recipient (Sean) --output ("secret-message.txt.gpg")

Explanation:

PGP encryption from the command line can be done using the following format:

  • pgp --encrypt (input) --recipient (user) --output (output file)

Therefore, PGP command line syntax to encrypt the my-message.txt file for a specific user (Sean) and save the output as secret-message.txt.gpg is:

  • pgp --encrypt "my-message.txt" --recipient (Sean) --output ("secret-message.txt.gpg")
6 0
2 years ago
Other questions:
  • Write a function called lucky_sevens that takes in one #parameter, a string variable named a_string. Your function #should retur
    15·1 answer
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • What character makes an assignment statement an assignment statement?
    15·1 answer
  • Which one is correct
    8·1 answer
  • Write a program that lets a maker of chips and salsa keep track of sales for five different types of salsa: mild, medium, sweet,
    14·1 answer
  • I need help ASAP please and thank you!
    6·1 answer
  • What would be used by a business to assess how the business is working within its organization goals? O A. Information systems B
    8·1 answer
  • What reforms were made by the British government in India after the war of independence? write any three
    5·1 answer
  • Consumers who wish to make a purchase from other consumer on ebay need tl
    10·1 answer
  • A file manager is used for all of the following except ____.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!