Page 1 of 1

B. The main function should perform the following: • Initialize the variable NB_LAPTOP with the sum of the first digit a

Posted: Fri Jul 08, 2022 6:36 am
by answerhappygod
B The Main Function Should Perform The Following Initialize The Variable Nb Laptop With The Sum Of The First Digit A 1
B The Main Function Should Perform The Following Initialize The Variable Nb Laptop With The Sum Of The First Digit A 1 (35.62 KiB) Viewed 28 times
B The Main Function Should Perform The Following Initialize The Variable Nb Laptop With The Sum Of The First Digit A 2
B The Main Function Should Perform The Following Initialize The Variable Nb Laptop With The Sum Of The First Digit A 2 (18.58 KiB) Viewed 28 times
B The Main Function Should Perform The Following Initialize The Variable Nb Laptop With The Sum Of The First Digit A 3
B The Main Function Should Perform The Following Initialize The Variable Nb Laptop With The Sum Of The First Digit A 3 (53.97 KiB) Viewed 28 times
B The Main Function Should Perform The Following Initialize The Variable Nb Laptop With The Sum Of The First Digit A 4
B The Main Function Should Perform The Following Initialize The Variable Nb Laptop With The Sum Of The First Digit A 4 (53.97 KiB) Viewed 28 times
B The Main Function Should Perform The Following Initialize The Variable Nb Laptop With The Sum Of The First Digit A 5
B The Main Function Should Perform The Following Initialize The Variable Nb Laptop With The Sum Of The First Digit A 5 (9.83 KiB) Viewed 28 times
B. The main function should perform the following: • Initialize the variable NB_LAPTOP with the sum of the first digit and the second digit of your AUM ID. if your ID is 40375, the value of NB_LAPTOP will be 4. (2 points) Prompt the user to enter the price (float) of NB LAPTOP laptops by using a while loop. (10 points) • • Print your first name, last name and your student ID on the screen. For example, if your name = xxx yyy, and ID = 40375, the program should print "Part B is created by student yyy xxx-ID=40375". (3 points) Print the average price of all laptops before and after discount as shown below in the sample output. The discount is applicable on laptops that cost from 100 to 200. The discount amount is equal to the value of your section number. For example, if your section number is F3, the discount amount is equal to 3%. (15 points)
//////Part B ////////////////// //// Please enter the cost of 4 laptops: 150 50 250 170 Part B is created by student: yyy xxx- ID = 40375 Item Original Price laptop-1 laptop-2 laptop-3 laptop-4 150.00 50.00 250.00 170.00 Total price with discount: 610.400 Total before discount: 620.000 Average price with discount: 152.600 Average price before discount: 155.000 Price with discount 145.50 50.00 250.00 164.90
Problem Write a C program that calculates the price of all laptops/destops and average rank of a company. The program's design should use only the main function. In the program, constant statement and else statement cannot be used. You should write code based on the covered materials; It is not allowed to include statements that are not covered in the class until the end of week 2. The main function should run successfully with different scenarios. The main function should perform the following: A. The main function should perform the following: • Initialize the variable NB with your section number. For example, if your section is F3, the value of NB will be 3. If your section is M5, the value of NB will be 5. If your section is M1 or F1 or M2 or F2, the value of NB should be equal to 5. Prompt the user to enter the rank and the gender of NB employees by using a do while loop. The rank value should be from 1 to 5 and the gender value should be 'M' or 'F' only. (15 points) Print your section number, your first name, your last name and your AUM ID on the screen. For example, if your first name = xxx, last name=yyy, section number = F3 and ID = 40375, the program should print "Part A is created by student yyy xxx-section F3 - ID= 40375". (3 points) • Calculate and print the average rank of male employees (1) and the average rank of all employees (2). (12 points)
3 M 4 F 3 M /////Part A ///// Enter data of 3 employees: Part A is created by student yyy xxx- section F3 ID=40375 The average rank 1 is 3.00 The average rank 2 is = 3.33