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...
-
For a one-way ANOVA, a. Identify one purpose of one-way ANOVA tables. b. Construct a generic one-way ANOVA table.
-
Write a function: string solution (string &S, string &T); that, given two strings S and T consisting of N and M characters, respectively, determines whether string T can be obtained from string S by...
-
Tools of environmental management need to be eco-efficient. What is ecoefficiency? What is an eco-efficient tool? Provide a critical analysis of the view that conventional life-cycle assessment is...
-
Combined data for three years for two firms appear below (in millions). One of these firms is Amazon.com, a rapidly growing internet retailer, and the other is Kroger, a retail grocery store chain...
-
What are differenet audit tests that can be used to identify material misstatement of accounts payable. and how can they be applied.
-
Product costs in the manufacturing company include: (A) Raw materials, work in process, and finished goods cost (B) Work in process, finished goods, raw materials (C) Finished goods, raw materials,...
-
A, B, C, and D represent the population of four towns in terms of t, the number of years since 2000. A = 600 (1.12) B = 1000(1.03) a. Which of the towns is experiencing a decline in population? C =...
-
Jada (age 53) and Elijah (age 60) are married, and both are self-employed. In 2023, they participate in a health insurance plan with a $3,000 annual deductible and out-of-pocket maximum of $9,000....
-
Part A) Ang Myat is a 32-year-old man who is originally from Myanmar and lived on the Thai-Burma border in a refugee camp since he was a teenager. He is accompanied by his friend Denpo for support....
-
Find dylax 1-xx l-xe y = (x-1) cos (5x) = (x-2x-1) x F y= 2 Find The Equation of the Tangent Line to the Graph of f (x) = (x-1) at X = -1
-
Bostron Inc. acquired 75% of Paris Co. on January 2, 2024. In 2024, Boston sold Paris $460,000 of goods, which had cost $380,000. Paris still owned 20% of the goods at the end of the year. In 2025,...
-
For a company named BRAND Burger targeting people from different nationalities by serving them burgers with taste and recipies from their country, going to be opened in BC Canada Make SWOT analysis....
-
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
-
What are the advantages of resource leveling?
-
Which of the following statements is false? A. The highest need in Maslows pyramid is called selfactualization. B. Most people today prefer managers who follow Theory X versus Theory Y. C. Herzberg...
-
Some project managers like to assess team performance by using a technique known as MBWA, which stands for _______________. A. management by wondering aloud B. management by wandering around C....
Study smarter with the SolutionInn App