A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a program that will calculate and print the parking charges for each of 3 customers who parked their cars in this garage yesterday. You should enter the hours parked for each customer. Your program should print the results in a neat tabular format and should calculate and print the total of yesterday's receipts. The program should use the function calculateCharges to determine the charge for each customer.
Find the state diagram for the following state table
AB AB
AB X=0 X=1
00 01 10
01 10 00
10 11 01
11 00 10
Write a c++ program using function that take an array of integers as input and return the
sum of number in the array.
Identify an error in the following pseudocode: (2)
sum = 0
for x = 1 to 10
if y MOD 2 = 0
display y
sum = sum + y
Melokuhle is a very young intelligent and adventurous individual. He has recently
bought 4 quantums (taxi) to transport people around the country. As a result, he is
planning a trip to Upington.
Therefore, he has hired you to write a program in pseudocode as well as in C++ to
evaluate the fuel consumption on his 4 cars during the planned trip. The kilometers
and fuel level in the tank at the start and end of the journey should be entered by the
end-user.
Calculate for each car, the fuel used, kilometers traveled, and the overall fuel
consumption in kilometers traveled per litre of fuel
Rewrite the following for-loop as a post-test do-loop. (5)
for x = 20 to -20 step -3
display "x = ", x
next x
Rewrite the following for-loop as a pre-test while-loop. (6)
for x = 1 to 10
for y = 10 to x
if y MOD 2 = 0 then
display "*"
else
display "#"
endif
display " " ~newline
Determine the exact output that is produced when the following code is executed.
for x = 1 to 10 step 1
for y = 1 to x step 1
if y MOD 2 = 0 AND x MOD 2 <> 0 || y MOD 2 <> 0 AND x MOD 2 = 0 then
display "*"
else
display "#"
endif
next y
display " " ~newline
next x
The Gaussian distribution also known as the Normal distribution, is given by the following
equation:
𝑦(𝑥) = 𝑒𝑥𝑝 −(𝑥−𝜇)^2/2𝜎^2
where parameter 𝝁 is the mean and 𝝈 the standard deviation.
(i) Write a MATLAB code to create a 1000 point Gaussian distribution of random numbers
having 𝜇 = 0 and 𝜎 = 1. (20)
(ii) Plot this distribution. (10)
Compare the Go-back N protocol with the rest of the protocols for effective frame transmission in Data link Layer detailed summary?