Question: WRITE A C++ PROGRAM Digitize an Integer Write a program that reads a positive integer, finds the digit-sum, and how many times each digit is
WRITE A C++ PROGRAM

Digitize an Integer Write a program that reads a positive integer, finds the digit-sum, and how many times each digit is repeated in the integer. Sample inputs / outputs: Please enter a positive integer: 1538525 The digit-sum of 1538525 is 29 There are: O zeros, 1 ones, 1 tows, 1 threes, O fours 3 fives. O sixes, o sevens, 1 eights, 0 nine Customer Bill A shop sales 5 types of items, the price of item number 1 is 2.99, the price of item number 2 is 4.5, the price of item number 3 is 9.99, the price of item number 4 is 3.0, the price of item number 5 is 6.0. Write a program that reads a series of pairs of numbers (item number and quantity sold). Your program should calculate and display the total customer bill of all items sold. Use -1 as a sentinel value. If the item number is not valid print an error message. Sample inputs / outputs: Enter the item number & Quantity: 27 Enter the item number & Quantity: 9 12 The value of the item is out of range Enter the item number & Quantity: 15 Enter the item number & Quantity: -1 0 Total bill is 46.45 Grade Point Average Write a program that reads the number of courses N taken by a student. The program reads the grade and the credit hours for N courses. The program calculates and prints the student grade-point average GPA. The grades are represented by 4 as the weight of A, by 3 as the weight of B. by 2 as the weight of C, by 1 as the weight of D, and by 0 as the weight of F. GPA = sum(credit * weight) / sum(credit) The GPA of the below input/output sample is: GPA =(3 * 3+3* 4+4* 2+2*1)/(3+3+4+2) = 2.58333 Sample inputs / outputs: Enter the number of courses: 4 Enter the grade and credit of course number 1: B 3 Enter the grade and credit of course number 2: A 3 Enter the grade and credit of course number 3: C 4 Enter the grade and credit of course number 4: D 2 The student GPA is 2.58333
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
