Question

I need this is PSEUDO CODE: NOTE: Assignment 4 should utilize only the following topics: Variables,...

I need this is PSEUDO CODE:

NOTE: Assignment 4 should utilize only the following topics: Variables, Assignment, Input/Output, Selection Structures and repetition structures (i.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.14999984 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

0 0
Add a comment Improve this question Transcribed image text
Answer #1


import java.util.*;
public class Cheggbiting {

   public static void main(String[] args) {
       // TODO Auto-generated method stub
       Scanner sc=new Scanner(System.in);
       double reducedweight=0.05; //setting value to reduce by 0.05
       System.out.println("what type of thing you are eating? ");
       String thing=sc.nextLine();
       System.out.println("how much does it weigh(in lbs)? ");
       double weight=sc.nextDouble();
       int i=1;
       double newweight;
       while(weight>reducedweight) //loop while weight>reducedweight
       {
           weight=weight-reducedweight; //calculation of new weight everytime
           System.out.println("you take bite #"+i+" of the "+thing+" that now weighs "+weight);
           i++;
       }
      

   }

}


DON'T FORGET TO LIKE.

THANKS BY HEART

Add a comment
Know the answer?
Add Answer to:
I need this is PSEUDO CODE: NOTE: Assignment 4 should utilize only the following topics: Variables,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please answer in: c++ and or pseudo code NOTE: Assignment 4 should utilize only the following...

    Please answer in: c++ and or pseudo code NOTE: Assignment 4 should utilize only the following topics: Variables, Assignment, Input/Output, Selection Structures and repetition structures (i.e. loops). 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...

  • I need help solving this assignment, you are given a full piece of code that does not run correctly. Some of the bugs ca...

    I need help solving this assignment, you are given a full piece of code that does not run correctly. Some of the bugs can be found at compile time, while others are found at run time. Access the UserMenu.cpp code file (in the zip file in Start Here) and use debugging practices and the debugger in Visual Studio to find each bug. Fix the bug and write a comment in the code giving a description of how you found the...

  • I need help with this assignment in C++, please! *** The instructions and programming style detai...

    I need help with this assignment in C++, please! *** The instructions and programming style details are crucial for this assignment! Goal: Your assignment is to write a C+ program to read in a list of phone call records from a file, and output them in a more user-friendly format to the standard output (cout). In so doing, you will practice using the ifstream class, I'O manipulators, and the string class. File format: Here is an example of a file...

  • In this assignment you are to utilize the Node data structure provided on Blackboard. In this...

    In this assignment you are to utilize the Node data structure provided on Blackboard. In this assignmet you are to write a main program that implements two methods and a main method as their driver. So, only main and two methods with it. Note: You may not use any of the LinkedList class provided on Blackboard, you may use the methods in it as a guide (you should actually look at them) but you cannot use any of the methods...

  • CS0007 Good day, I am in an entry-level Java class and need assistance completing an assignment....

    CS0007 Good day, I am in an entry-level Java class and need assistance completing an assignment. Below is the assignment criteria and the source code from the previous assignment to build from.  Any help would be appreciated, thank you in advance. Source Code from the previous assignment to build from shown below: Here we go! Let's start with me giving you some startup code: import java.io.*; import java.util.*; public class Project1 { // Random number generator. We will be using this...

  • I need help with this code, I'm stuck on it, please remember step 4, I'm very...

    I need help with this code, I'm stuck on it, please remember step 4, I'm very much stuck on that part. It says something about putting how many times it appears Assignment #1: Sorting with Binary Search Tree Through this programming assignment, the students will learn to do the following: Know how to process command line arguments. 1 Perform basic file I/O. 2. Use structs, pointers, and strings. Use dynamic memory. 3. 4. This assignment asks you to sort the...

  • I need this in C++. This is all one question. Introduction Your eighth assignment will consist...

    I need this in C++. This is all one question. Introduction Your eighth assignment will consist of two programs, which will involve the use of simple classes. The source code for these problems should be submitted using the naming conventions we specified in class. Please note that your computer programs should comply with the commenting and formatting rules as described in class. For example, there should be a header for the whole program that gives the author's name, class name,...

  • Problem: Pick Up Sticks For this assignment you will be creating an interface for two humans...

    Problem: Pick Up Sticks For this assignment you will be creating an interface for two humans to play a simple game of "Pick Up Sticks". Here's how the game is played in the "real world": The game begins with a number of sticks on a table (between 10 and 100) Each player, in turn, takes between 1-3 sticks off the table. The player to take the last stick loses. Your job is to build a virtual version of the game...

  • C++ language I need to update this code with the following: ask the user for how...

    C++ language I need to update this code with the following: ask the user for how many structures they would like. Once you get the number, allocate an array of pointers. Once they have been created, proceed to loop through and get the data as usual, and display it back to the screen. struct record {    int age;    string name; }; int check(record r[], int n, string nm) {    for (int i = 0; i < n;...

  • Create java code Make sure it runs Part 1: Your little sister has decided that she...

    Create java code Make sure it runs Part 1: Your little sister has decided that she wants a pet. You love animals and want to further engender her love of animals, but, well, her last pet, goldie the goldfish, didn’t fare too well. So you went on the hunt for a different kind of pet that will fit the bill. Much to your joy, you have found the perfect pet for her… a Bee farm! They are easy to take...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT