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 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
Answer:
#include <iostream>
using namespace std;
int main()
{
string name;
cout<<"What type of thing are you eating? ";
cin>>name;
float weight;
cout<<"How much does it weigh (in lbs)? ";
cin>>weight;
int i=1;
while(weight>=0.05)
{
weight = weight - 0.05;
cout<<"You take bite #"<<i<<" of the
"<<name<<" that now weighs "<<weight<<"
lbs"<<endl;
i++;
}
return 0;
}
Output:
PLEASE UPVOTE IF YOU FOUND THIS HELPFUL!
Please answer in: c++ and or pseudo code NOTE: Assignment 4 should utilize only the following...
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...
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...
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...
write a detailed summary in an organized format. It must include 3-4 key points of the controversy. Break up your summary in 3-4 paragraphs. Must include specific reasons as to why a vegetarian diet can be better and or worse than the meat heavy diets? Explain briefly using examples how reading this controversy has helped you in making better dietary choices in future? CONTROVERSY 6 Table of Contents Vegetarian and Meat-Containing Diets: What Are the Benefits and Pitfalls? Notebook LO...
Can you please help me with creating this Java Code using the following pseudocode? Make Change Calculator (100 points + 5 ex.cr.) 2019 In this program (closely related to the change calculator done as the prior assignment) you will make “change for a dollar” using the most efficient set of coins possible. In Part A you will give the fewest quarters, dimes, nickels, and pennies possible (i.e., without regard to any ‘limits’ on coin counts), but in Part B you...
C++ Programming Question: This programming assignment is intended to demonstrate your knowledge of the following: ▪ Writing a while loop ▪ Write functions and calling functions Text Processing [50 points] We would like to demonstrate our ability to control strings and use methods. There are times when a program has to search for and replace certain characters in a string with other characters. This program will look for an individual character, called the key character, inside a target string. It...
The following are screen grabs of the provided files Thanks so much for your help, and have a nice day! My Java Programming Teacher Gave me this for practice before the exam, butI can't get it to work, and I need a working version to discuss with my teacher ASAP, and I would like to sleep at some point before the exam. Please Help TEST QUESTION 5: Tamagotchi For this question, you will write a number of classes that you...
Need answers. thank you VOCABULARY BUILDER Misspelled Words Find the words below that are misspelled; circle them, and then correctly spell them in the spaces provided. Then fill in the blanks below with the correct vocabulary terms from the following list. amino acids digestion clectrolytes nutrients antioxident nutrition basal metabolic rate extracellulare oxydation calories fat-soluble presearvatives catalist glycogen processed foods cellulose homeostasis saturated fats major mineral coenzyeme trace minerals diaretics metabolism water-soluable 1. Artificial flavors, colors, and commonly added to...