Question: can someone please help with the three programing in java Loops Assignment Outcomes By completing this assignment, students will be able to: 1) Design programs

can someone please help with the three programing in java  can someone please help with the three programing in java Loops
Assignment Outcomes By completing this assignment, students will be able to: 1)
Design programs that leverage loops to solve problems 2) Apply concepts from

Loops Assignment Outcomes By completing this assignment, students will be able to: 1) Design programs that leverage loops to solve problems 2) Apply concepts from earlier in the semester, including conditional statements 3) Generate and use random numbers 4) Solve problems of increasing complexity NOTE: Assignment 4 should utilize only the following topics: Variables, Assignment, Input/Output, Selection Structures and repetition structures (.e. loops). Program 1: Hungry? In the United States, we tend to be obsessed with eating large animals. We have sayings of "I'm so hungry, I could eat a horse and ask meaningful questions like "How do you eat an elephant? One bite at a time!" For this assignment, you're going to put things in perspective. You will ask the user how many pounds the object they will be eating weighs, then calculate both how many bites it takes to eat the object and how long it takes total to eat it. Assume that each bite reduces the object you are eating by 0.05 pounds (lbs). Design (pseudocode) and implement (source code) for this program. BTW, an African Bush elephant can weight 13,000 lbs. How many bites would that be? Sample run 1: What type of thing are you eating? cheese How much does it weigh (in lbs)? 1 You take bite #1 of the cheese that now weighs 0.95 lbs You take bite #2 of the cheese that now weighs 0.9 lbs You take bite #3 of the cheese that now weighs 0.84999996 lbs You take bite #4 of the cheese that now weighs 0.79999995 lbs You take bite #5 of the cheese that now weighs 0.74999994 lbs You take bite #6 of the cheese that now weighs 0.6999999 lbs You take bite #7 of the cheese that now weighs 0.6499999 lbs You take bite #8 of the cheese that now weighs 0.5999999 lbs You take bite #9 of the cheese that now weighs 0.5499999 lbs You take bite #10 of the cheese that now weighs 0.49999988 lbs You take bite #11 of the cheese that now weighs 0.44999987 lbs You take bite #12 of the cheese that now weighs 0.39999986 lbs You take bite #13 of the cheese that now weighs 0.34999985 lbs You take bite #14 of the cheese that now weighs 0.29999983 lbs You take bite #15 of the cheese that now weighs 0.24999984 lbs You take bite #16 of the cheese that now weighs 0.19999984 lbs You take bite #17 of the cheese that now weighs 0.14 999984 lbs You take bite #18 of the cheese that now weighs 0.099999845 lbs You take bite #19 of the cheese that now weighs 0.049999844 lbs Program 2: Buh-RING IT! For this assignment, you're going to simulate a text-based Role-Playing Game (RPG). Design (pseudocode) and implement (source) for a program that reads in 1) the hero's Hit Points (HP-or health), 2) the maximum damage the hero does per attack, 3) the monster's HP and 4) the maximum monster's damage per attack. When the player attacks, it will pick a random number between 0 and up to the maximum damage the player does, and then subtract that from the monster. The same thing happens when the monster attacks the hero, but damage is to the hero. The program should display rounds and the HP of the hero and monster each round. If the hero or monster dies, it should print that this happened and should NOT continue (ie, no extra text). To learn how to create random numbers, see the appendix. Sasporun 1: Enter the hero's starting hit points: 50 Enter the damage the hero's weapon does per strike: 20 Enter the monster's starting hit points: 40 Enter the monster's damage per strike: 15 ROUND 1 Hero attacks for: 10 Monster has 30 HP left Monster attacks you for: 1 You have 49 HP left ROUND 2 Hero attacks for: 18 Monster has 12 HP left Monster attacks you for: 7 You have 42 HP left ROUND 3 Hero attacks for: 0 Monster has 12 HP left Monster attacks you for: 14 You have 2B HP left - ROUND 4 - Hero attacks for: 18 Monster has -6 HP left The monster dies and you earn 5 XP Battle ends... Sample run 2 : Enter the hero's starting hit points: 50 Enter the damage the hero's weapon does per strike: 10 Enter the monster's starting hit points: 40 Enter the monster's damage per strike: 20 ROUND 1 Hero attacks for: 1 Monster has 39 HP left Monster attacks you for: 6 You have 44 HP left ROUND 2 Hero attacks for: 5 Monster has 34 HP left Monster attacks you for: 1 You have 43 HP Left ROUND 3 Hero attacks for: 8 Monster has 26 HP left Monster attacks you for: You have 35 HP left ROUND 4 Hero attacks for: 4 Monster has 22 HP left Monster attacks you for: 5 You have 30 HP left ROUND 5 Hero attacks for: 7 Monster has 15 HP left Monster attacks you for: 1 You have 29 HP left ROUND 6 Hero attacks for: 7 Monster has 8 HP left Monster attacks you for: 9 You have 20 HP left ROUND 7 Hero attacks for: 0 Monster has HP left Monster attacks you for 14 You have 6 HP left ROUND Hero attacks for: 4 Monster has 4 HP left Monster attacks you for: 11 You have 5 HP left You are killed by the monster and lose 10 gold. Battle ends... Program 3: National Debt. One thing that should worry anyone is financial debt. If you're like most others, you have credit card debt, student loans and so on. Our nation has similar debts, including debt to its citizens (e.g. bonds), debt to social programs, and debt to other nations. If you'd like to see where we stand, check out https://www.usdebtclock.org/. If you'd like to see how we compare to other nations, check out the "World Debt Clocks in the upper-left corner. How do these debt clocks work? It's exceptionally complicated, but a lot of national debt comes from issuing Treasure Notes (eg a 10-year Treasury Note) that currently yield 3.6% interest. Your task is to write a program that prompts the user for a national debt (expressed in billions of dollars), the interest rate, and calculate how much debt is generated per year (assuming no debt is paid off by the GDP) over a 10-year period. For example, if a country currently has 1,000 billion" (.e. a trillion) dollars of debt, it will generate 36 billion dollars of additional debt in a year. The next year, the debt of 1036 billion would generate 37.296 billion additional dollars of debt, totaling 1073.296 dollars of debt. Enter the starting debt in billions: $1000 Enter the interest rate: 3.6 Year 1 Debt generated this year is $36.0 Accumulated debt from interest is now $36.0 Total debt is now $1036.0 billion dollars Year 2- Debt generated this year is $37.295998 Accumulated debt from interest is now $73.296 Total debt is now $1073.296 billion dollars Year 3 Debt generated this year is $38.638657 Accumulated debt from interest is now $111.934654 Total debt is now $1111.9347 billion dollars Year 4 Debt generated this year is $40.029648 Accumulated debt from interest is now $151.9643 Total debt is now $1151.9644 billion dollars

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!