Devam Ediyor

486156 C++ Week 1: 2.19 & 3.12

2.19

Write a program that inputs three integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers. The screen dialog should appear as follows:

Input three different integers: 13 27 14

Sum is 54

Product is 4914

Smallest is 13

Largest is 27

Name this project: Project 1

3.12

Create an Account class that a bank might use to represent customer's bank accounts. Include a data member of type int to represent the account balance. (Note: In subsequent chapters, we'll use numbers that contain decimal points (e.g., 2.75)-called floating-pint values to represent dollar amounts.) Provide a constructor that receives an initial balance and uses it to initialize the data member. The constructor should validate the initial balance to ensure that it's greater than or equal to 0. If not, set the balance to 0 and display an error message indicating that the initial balance was invalid. Provide three member functions. Member function credit should add an amount to the current balance. Member function debit should withdraw money from the Account and ensure that the debit amount does not eceed the Account's balance. If it does, the balance should be left unchanged and the function should print a message indicating "Debit amount exceeded account balance." Member function getBalance should return the current balance. Create a program that creates two Account objects and tests the member functions of class Account.

Name this project: Project 2.

Beceriler: Her şey Kabul, C Programlama

Daha fazlasını görün: programming keyboard, integers and, dollar bank, c programming functions, c programming function, c programming class, programming tests, bank account name, g+12, create 1-2, customer name error, customer accounts program, account class, average function, use programming class project, write program bank account, create bank program program, keyboard dialog, program bank account, function average numbers, program bank, write program add integers, different tests, input numbers average, program input numbers average

İşveren Hakkında:
( 17 değerlendirme ) Overland Park, United States

Proje NO: #2232066

Seçilen:

AcrossSloution

Please see the PM

0 gün içinde 10$ USD
(0 Değerlendirme)
0.0