Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Did you know that in lotteries, a 3-digit number with the same numbers in all digits like 777 will hit the jackpot in a casino? In the same manner, let's make a program that will test if a certain 3-digit number hits a jackpot or not by identifying if all the digits of a given number is the same as the second inputted number. If it is, print "Jackpot!"; else, print "Nah".


Let's try this out now!


Input


1. 3-digit number

2. Digit to be checked

Output


The first line will contain a message prompt to input the 3-digit integer.

The second line will contain a message prompt to input the digit to be checked.

The last line contains the appropriate string.


Company ABC in Kenya pays its employees based on a commission of the sales they make as

illustrated in the table below:

Monthly Sales Commission Rate

First 50,000 10%

Next 100,000 15%

Next 200,000 20%

Above 350,000 25%

Additionally, all employees are entitled to a basic commission of 20,000 per month.

a. Draw a flowchart that allows a HR employee to input an employee’s monthly sales,

computes the commission due to the employee and displays it to the HR employee.

[7 Marks]

b. Write a C++ program implementation of the flowchart above. [8 Marks]


 Company ABC in Kenya pays its employees based on a commission of the sales they make as 

illustrated in the table below:

Monthly Sales Commission Rate

First 50,000 10%

Next 100,000 15%

Next 200,000 20%

Above 350,000 25%

Additionally, all employees are entitled to a basic commission of 20,000 per month.

a. Draw a flowchart that allows a HR employee to input an employee’s monthly sales, 

computes the commission due to the employee and displays it to the HR employee.

[7 Marks]

b. Write a C++ program implementation of the flowchart above. [8 Marks]


Given the following array of 8 integers {2,3,2,1,2,5,8,2} you are required to write a C++ program that will loop through it and re-arrange it into the following final output {5,3,1,8,2,2,2,2} and display it . The idea is to position all values equal to 2 in the array to come after the other values not equal to 2. The order of the other values i.e 5,1,3 and 8 does not matter as long as they appear positioned before all 2s as illustrated in the hint below: Initial array: {2,3,2,1,2,5,8,2} NumbertoMove = 2 Final Array: {5,3,1,8,2,2,2,2} Write an algorithm as a pseudocode to solve the problem above.


What can "GetLastError()" function do, explain?


Write C++ program to write “Hello World" inside file in path D:\output\os.txt then calculate the size of that file.


 Write C++ program to swap two input values using: a) Call by address function. b) Call by reference function.


write c++ program to create process and wait for 15 seconds then terminate it. path: "c:\\windows\\system32\\notepad.exe"


Write a complete c program for the following problem; get three numbers from the user, and calculate and display the product (multiplication) of numbers


You are an employee of a marketing organization that pays you a monthly salary of Ksh. 10,000 if you work for the recommended 160 hours a month (Monday - Friday, 9am - 5pm, for a month). This salary can however fluctuate based on the number of hours worked, in that if you work for more than the recommended working hours ie above 160 hours, you earn an extra 10% of your salary but if you work for less than 160 hours, you will be deducted 10% of your salary. With the aid of a SWITCH CASE select structure Implement a program written in C++ that would help the finance department calculate your monthly salary based on the hours worked being the input value of the program.


LATEST TUTORIALS
APPROVED BY CLIENTS