A perfect number is an integer that is equal to the sum of its factors. For example, 6 is a perfect number
as 6 = 3+2+1. Write down a program that takes an integer x as an input and prints all perfect numbers
from 1 to x.
A cannon ball is thrown straight into the air with velocity
v0. Position of the cannon ball after t seconds is given by, s = vi t – (1/2) gt.You are required to confirm equation by a simulation. In simulation, you will consider how the ball moves in very short time interval Δt.In a short time interval, the velocity v is nearly constant, and we can compute distance the ball moves using Δs = vΔt. Δt is a constant double with value 0.01. Get updated position using s = s + v * Δt. Velocity changes constantly—in fact, it is reduced by the gravitational force. In a short time interval, Δv = –gΔt, you must keep the velocity updated as v = v - g * Δt; In next iteration, new velocity is used to update distance.You need to run simulation until cannon ball falls back to ground. Take initial velocity as input. Update position and velocity 100 times per second, but print out the position only every full second. Also, printout values from exact formula s = vi t – (1/2) gt2 for comparison. Lastly plot path.
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.
starlight company has revised their employees salaries. they had a certain criteria on which they decided the total increment value of employee on their salary, following is the criteria:
20% increase if he has only worked on company's local projects
25% increase if he has only worked on company's international projects
30% increase if he has worked on company's both local & international
Now you are required to ask from 5 employees salary.
Question 3 [5 Marks]
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.
The whole system allows up to 10 processes currently stay in the memory, only one of them is running on the CPU, while the others are either in the Ready Queue, or blocked in the Disk Queue (i.e. waiting for disk I/O). Each process has its PCB. just follow the format in the textbook. For memory management, you may choose paging (page size 64 byte or larger) or other management methods. No requirement on
deadlock prevention or virtual memory.
Write a program that fills an integer array of 10 numbers From the user in an array Then print out the smallest number
Techics Comp has 5 salesmen. Each salesman keeps track of the number of computer sold each month. The manager assigns a number, 1 to 5, to each salesperson with their name.
Write a complete C++ program to store the number of computers sold by each salesperson in the array comp[] and output the total number of computer sold for the given month. The program will calculate and display the highest and the lowest number of computer sold for the month together with the salesperson’s name. It also can search the amount of sold computers by the salesperson whether it was exist or not. If found, display the salesperson name. If not, display it is not exist.
Your program should allow the user to repeat this process as often as the user wishes.
Write a program that fills an integer array of 1000 random numbers
between 1-100
Next count the number 6 appears in the array and output this information to the console.