It consists of an outer material (like glass), and an inn material(like sand) that flows through...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
It consists of an outer material (like glass), and an inn material(like sand) that flows through the upper chamber do below, and the width of the opening between is adjusted measure the flow of time. Obviously when all of the sand h deposited into the bottom chamber the hourglass can be flipp to resume the time flow process. Your task is to design a visu version of the hourglass that can receive commands from t user, to depict the current time on a timeline. Problem Specification You will be designing an hourglass like structure (show below The size of the hourglass will remain constant. It will contain rows for the outer material, and 24 rows to house the inn material. The material used for the outer and inner may different and should be entered by the user. In the examp below, the outer material is shown using "#" and the inn material is shown using ".". The figure on the left shows the initial status of the hourgla where all of the inner material is in the upper chamber. As tir is being scrubbed, the inner material will "flow" between ea chamber to represent the current time. Time starts from 0 a updates every hour from 0-12 after which it resets back to 0 a so on. For example, the time shown on the figure on the rig shows when t= 7, as there are 7 rows of inner material deposit on the lower chamber XX Input and Output Your program should accept the following inputs from the user and display the following. 1. First, you should accept two parameters from the user, the character used to render the outer border, and the character used to render the inner material. These should be done using prompts. 2. Once you have obtained the appropriate inputs, you should display the initial clock at time t-0. This will look like the figure above (on the left). 3. Next, you should start a loop, to continually accept user inputs (using prompt) and update the clock accordingly You should accept 4 types of inputs next The next command advances the timeline by hour. Naturally, your clock should be updated to display the current time. For each next command a row of inner material should fall from the upper chamber and deposi on the lower chamber. When t-12, the subsequent nex command should imply the hourglass be flipped, and you should start back up with a full upper chamber and ar empty lower chamber. prev - The prev command rolls back time by 1 hour. Your clock should be updated to display the time accordingly i.e., a row of inner material should rise back to the upper chamber. When t = 0, the subsequent prev command should start off with a full lower chamber and an empty upper chamber nexus - The nexus command signifies a nexus event has occurred. A nexus event occurs when someone does something they are not supposed to. (chaotic alterations of a predetermined outcome). These can lead to all sorts of issues, like branched timelines, so in these cases the timeline should be reset back to t= 0. Your clock should also be updated to reset back to the starting configuration. quit - Even TVA analysts need a break. This command should exit out of your I/O loop and stop your script. run of your program will look like. Program Constraints You MUST not hardcode anything other than hardcoding the size of the clock to a variable say (N). I used N = 14, since the structure of the clock essentially is 2 inverted triangles on top of each other, with the tip of the triangles removed. So, you can design your program to render the upper half first and then the lower half. Each half will require you to have some nested loops to implement your logic. Related to above, but please make sure you are using repetition structures like for and while loops to implement the logic described in the program description. Programs that have hardcoded the display for each line will not receive ANY credit. The whole idea is to practice loops, so please make sure your code doesn't have any obvious repetitions that can be put in a loop. You are NOT allowed to use any data structures not covered in class prior to posting this assignment, so no arrays, lists or any other data structure. You don't need them. It consists of an outer material (like glass), and an inn material(like sand) that flows through the upper chamber do below, and the width of the opening between is adjusted measure the flow of time. Obviously when all of the sand h deposited into the bottom chamber the hourglass can be flipp to resume the time flow process. Your task is to design a visu version of the hourglass that can receive commands from t user, to depict the current time on a timeline. Problem Specification You will be designing an hourglass like structure (show below The size of the hourglass will remain constant. It will contain rows for the outer material, and 24 rows to house the inn material. The material used for the outer and inner may different and should be entered by the user. In the examp below, the outer material is shown using "#" and the inn material is shown using ".". The figure on the left shows the initial status of the hourgla where all of the inner material is in the upper chamber. As tir is being scrubbed, the inner material will "flow" between ea chamber to represent the current time. Time starts from 0 a updates every hour from 0-12 after which it resets back to 0 a so on. For example, the time shown on the figure on the rig shows when t= 7, as there are 7 rows of inner material deposit on the lower chamber XX Input and Output Your program should accept the following inputs from the user and display the following. 1. First, you should accept two parameters from the user, the character used to render the outer border, and the character used to render the inner material. These should be done using prompts. 2. Once you have obtained the appropriate inputs, you should display the initial clock at time t-0. This will look like the figure above (on the left). 3. Next, you should start a loop, to continually accept user inputs (using prompt) and update the clock accordingly You should accept 4 types of inputs next The next command advances the timeline by hour. Naturally, your clock should be updated to display the current time. For each next command a row of inner material should fall from the upper chamber and deposi on the lower chamber. When t-12, the subsequent nex command should imply the hourglass be flipped, and you should start back up with a full upper chamber and ar empty lower chamber. prev - The prev command rolls back time by 1 hour. Your clock should be updated to display the time accordingly i.e., a row of inner material should rise back to the upper chamber. When t = 0, the subsequent prev command should start off with a full lower chamber and an empty upper chamber nexus - The nexus command signifies a nexus event has occurred. A nexus event occurs when someone does something they are not supposed to. (chaotic alterations of a predetermined outcome). These can lead to all sorts of issues, like branched timelines, so in these cases the timeline should be reset back to t= 0. Your clock should also be updated to reset back to the starting configuration. quit - Even TVA analysts need a break. This command should exit out of your I/O loop and stop your script. run of your program will look like. Program Constraints You MUST not hardcode anything other than hardcoding the size of the clock to a variable say (N). I used N = 14, since the structure of the clock essentially is 2 inverted triangles on top of each other, with the tip of the triangles removed. So, you can design your program to render the upper half first and then the lower half. Each half will require you to have some nested loops to implement your logic. Related to above, but please make sure you are using repetition structures like for and while loops to implement the logic described in the program description. Programs that have hardcoded the display for each line will not receive ANY credit. The whole idea is to practice loops, so please make sure your code doesn't have any obvious repetitions that can be put in a loop. You are NOT allowed to use any data structures not covered in class prior to posting this assignment, so no arrays, lists or any other data structure. You don't need them.
Expert Answer:
Answer rating: 100% (QA)
Below is a Python program that implements the hourglass clock simulation with the ability to accept ... View the full answer
Related Book For
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts
Posted Date:
Students also viewed these programming questions
-
How do the lakers, or any other sports team use the BLIP model? 1b. What would you do differently than the organization you selected, in any of the stages of the BLIP Model?...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
On January 1, 20x1, Allan Co. purchased 400,000 bonds for 392,000. The bonds mature on January 1, 20x5 and pay 12% annual interest beginning January 1, 20x2. Transaction costs are negligible. The...
-
For flow past a cylinder of radius R as in Fig P7.50, the theoretical in viscid velocity distribution along the surface is U =2Uosin(x/R), where Uo is the oncoming stream velocity and x is the arc...
-
Recall that [[x] is the greatest integer function. For R of (a) (b) (x [y]) dA IR
-
Ecologists often measure the biodiversity of a region by the number of distinct species that exist in the region. Nature reserves are lands specifically designated by the government to help maintain...
-
Lauren Tarson and Michele Progransky opened Top Drawer Optical seven years ago with the goal of producing fashionable and affordable eyewear. Tarson and Progransky have been very pleased with their...
-
Lakeside Incorporated manufactures four lines of remote control boats and uses activity-based costing to calculate product cost. Activity Pools Machining Estimated Total Cost Setup $639,600 101,625...
-
Denise Lopez, age 40, is single and has no dependents. She is employed as a legal secretary by Legal Services, Inc. She owns and operates Typing Services located near the campus of Florida Atlantic...
-
Security and privacy have, for the most part, been seen as the responsibility of network engineers because most data and processing have been contained within the enterprises' walls. Now that mobile...
-
What are the key components of an effective goal-setting phase in the HR planning process? Communicating a program's details to the affected employees Creating a transitional matrix Identifying a...
-
QUESTION FOUR (20 MARKS) The following data shows two treatment methods of Renal patients in one hospital. Group A: Surgically placed Catheter Infection Times: Censored Observations 1.5 3.5 4.5 4.5...
-
In K-1 section L Partner's Capital Account Analysis what data is used from documents?
-
Using only the information in the table below, approximately how much would you pay today for an investment that pays $0 annual interest, but earns 8 percent interest over the next four years and has...
-
Jason uses Your Money Accounting to handle his business needs. He recently read a story in the newspaper that an accountant from that firm was arrested on charges of embezzlement. Jason now assumes...
-
Problem based on Bayesian variable selection based on g-prior in normal linear regression models.
-
A circular concrete shaft liner with Youngs modulus of 3.4 million psi, Poissons ratio of 0.25, unconfined compressive strength 3,500 psi and tensile strength 350 psi is loaded to the verge of...
-
An Arkansas statute provides that if any foreign corporation authorized to do business in the State should remove to the Federal court any suit brought against it by an Arkansas citizen or initiate...
-
Barta entered into a written contract to buy the K&K Pharmacy, located in the local shopping center. Included in the contract was a provision stating that this Agreement shall be contingent upon...
-
Advanced Alloys, Inc., issued a check in the amount of $2,500 to Sergeant Steel Corporation. The check was presented for payment fourteen months later to the Chase Manhattan Bank, which made payment...
-
A thin stainless steel disk of thickness \(b\) and outer radius \(r_{o}\) has been heat treated to a high, uniform initial temperature of \(T_{i}\). The disk is then placed upon a small stand and...
-
A plane wall of a furnace is fabricated from plain carbon steel \(\left(k=60 \mathrm{~W} / \mathrm{m} \cdot \mathrm{K}, ho=7850 \mathrm{~kg} / \mathrm{m}^{3}, c=430 ight.\) \(\mathrm{J} / \mathrm{kg}...
-
A steel sphere (AISI 1010), \(100 \mathrm{~mm}\) in diameter, is coated with a dielectric material layer of thickness \(2 \mathrm{~mm}\) and thermal conductivity \(0.04 \mathrm{~W} / \mathrm{m} \cdot...
Study smarter with the SolutionInn App