Q4 a. The classical Tower of Hanoi (ToH) puzzle is well-known. It consists of three pegs...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Q4 a. The classical Tower of Hanoi (ToH) puzzle is well-known. It consists of three pegs and disks of sizes 1.2, ....n arranged on one of the pegs as a "tower", in decreasing order of size, from bottom to top. The goal of the puzzle is to transfer all disks to another peg, placed in the same order. At each step, a single disk is moved from (the top of) one peg to (the top of) another, subject to the "divine" nule: to never have a larger disk above a smaller one. Write an algorithm ad draw the flow chart for moving all the disks from Peg A to Peg C. 10 Marks b. Employees of a certain firm are paid on hourly basis at the end of each week. If an employee works up to 40hrs, the employee is paid 6 cedis and 7 cedis per hour for a male and female respectively. If an employee works for more than 50 hours then the employee is also paid 2.5 the corresponding regular rate for hours worked in excess of 40. All employees are to pay 10 % of their gross as INCOME TAX and 2.5% towards the NHIS. If an employee has more than 3 children then he or she pays 2 cedis per child in excess of three towards GETFUND. Write an algorithm and draw a flow chart for a software solution that can solve for the above problem. 15 marks. Q4 a. The classical Tower of Hanoi (ToH) puzzle is well-known. It consists of three pegs and disks of sizes 1.2, ....n arranged on one of the pegs as a "tower", in decreasing order of size, from bottom to top. The goal of the puzzle is to transfer all disks to another peg, placed in the same order. At each step, a single disk is moved from (the top of) one peg to (the top of) another, subject to the "divine" nule: to never have a larger disk above a smaller one. Write an algorithm ad draw the flow chart for moving all the disks from Peg A to Peg C. 10 Marks b. Employees of a certain firm are paid on hourly basis at the end of each week. If an employee works up to 40hrs, the employee is paid 6 cedis and 7 cedis per hour for a male and female respectively. If an employee works for more than 50 hours then the employee is also paid 2.5 the corresponding regular rate for hours worked in excess of 40. All employees are to pay 10 % of their gross as INCOME TAX and 2.5% towards the NHIS. If an employee has more than 3 children then he or she pays 2 cedis per child in excess of three towards GETFUND. Write an algorithm and draw a flow chart for a software solution that can solve for the above problem. 15 marks.
Expert Answer:
Related Book For
Vector Mechanics for Engineers Statics and Dynamics
ISBN: 978-0073212227
8th Edition
Authors: Ferdinand Beer, E. Russell Johnston, Jr., Elliot Eisenberg, William Clausen, David Mazurek, Phillip Cornwell
Posted Date:
Students also viewed these programming questions
-
Are top executives of larger companies paid significantly more than those of smaller companies? Consider data on CEO pay (dollars) and market capitalization (the total market value of stock, in $...
-
If you are paying three employees $9 per hour and the fence installation in Exercise 40 requires 21 hours when all three employees are working, determine how much you will be required to pay in...
-
Three identical circular disks A, B, and C are welded to the ends of three identical solid circular bars (see figure). The bars lie in a common plane and the disks lie in planes perpendicular to the...
-
Explain how each of the following illustrates one of the four principles of interaction. a. At a college tutoring co-op, students can arrange to provide tutoring in subjects they are good in (like...
-
Tour province administers to students in public schools and high schools standardized tests of reading, writing, and mathematics. Reports are produced both by school and for the province overall...
-
In August 2015, the last month of its scal year, Goldwaithe Township issued $88,000 worth of tickets for parking and trafc violations. Of these, the township collected $45,000. It expects to collect...
-
An investment is guaranteed to have a unique value of IRR if which of the following is true? a. Alternating positive and negative cash flows b. An initial negative cash flow followed by all positive...
-
Matching Place the abbreviations corresponding to the appropriate reporting attribute(s) in the spaces provided for each financial statement. Include all that apply. Activities or Funds Basis of...
-
A. Let the number be presented by the variable "x". Translate the following mathematical phrases/sentences to mathematical symbol. Statement 1. The product of a number and seven is equal to two more...
-
Garden Glory Project Questions Assume that Garden Glory designs a database with the following tables: OWNER (OwnerID, OwnerName, OwnerEmail, OwnerType) OWNED_PROPERTY (PropertyID, PropertyName,...
-
Find the nominal annual rate of interest for the following investment. Principal $1177.00 Future Value $2867.12 Time Due 8 years Frequency of Conversion monthly The nominal annual rate of interest is...
-
Make the following assumptions: (i) client and server are connected by a direct link, whose transmission rate is R, (ii) round-trip time (RTT) between client and server is denoted by T. (iii) the...
-
Assume a cache (web proxy) is deployed in company A LAN. Assume the following about user's requests and network links: RTT from the company router to origin server: 1 sec The company access link...
-
CNNs capital structure is made of 50% ordinary shares; 30% preference share and 20% debt, cost of debt is 9 per cent. The risk-free rate is 3%, beta of CNN is 1.20 and the market risk premium is 12%....
-
find out the common element between two matrices given by user by c language
-
Suppose x, and x are two input neurons and z, and z2 are the hidden neurons with single output y in a neural network. Weights between input and hidden neurons are {v., Vas, Viz, Vaz), and between...
-
1. The ------------ of the desert explains why so many Egyptian Mummies are still intact,whereas the humidity of the tombs in tropical rain forests support the agents of decay sothat few Aztec...
-
What are conversion costs? What are prime costs?
-
Determine the radius of curvature of the path described by the particle of Prob. 11.97 when t = 0.
-
As the driver of an automobile travels north at 20 km/h in a parking lot, he observes a truck approaching from the northwest. After he reduces his speed to 12 km/h and turns so that he is traveling...
-
The reflector of a small flashlight has the parabolic shape shown. Determine the surface area of the inside of the reflector. -15 mm
-
Martin Galloway, the sole proprietor of a consulting business, has gross receipts of $45,000 in 2017. His address is: 1223 Fairfield Street, Westfield, New Jersey and his SSN is 158-68-7799. Expenses...
-
Probest Corporation (a calendar-year corporation) purchased and placed the following assets in service during the year All assets are used 100 percent for business. $100,000 of the cost of the...
-
In May 2016, Jose purchased a used automobile for $12,000 and used it 75 percent for business. No Section 179 election was made for this asset. In 2017, Joses business use of the automobile decreased...
Study smarter with the SolutionInn App