Question

1) Moon Weight Calculation:
Your weight is actually the amount of gravitational force exerted on you by the earth. Moons gravity is one sixth (0.167)that of the earth gravity.Write a program that asks the user to enter his/her weight on the earth and display the corresponding weight on the moon. The cpp file name should be moon.cpp.
2) How many calories:
A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 “servings” in the bag and that a serving equals 300 calories. Write a program that asks the user to input how many cookies that he/she ate and the report how many total calories were consumed. The cpp file name should be cookies.cpp.
3) Word game:
Write a C++ program that plays a word game with the user.The program should ask the user to enter the following:
- Name
- Age
- The name of the City
- The name of the College
- A profession
- A type of an animal
- A pet’s name
After user has entered these items, the program should display the following story, inserting the user’s input into the appropriate locations.
There once was a person named NAME who lived in CITY. At the age of AGE,NAME went to college at COLLEGE. NAME graduated and went to work as a PROFESSION. Then,NAME adopted a(n) ANIMAL named PETNAME. They both lived happily ever after. Hint: use appropriate date types for each variable. The cpp file name should be wordgame.cpp.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

include<iostream>
#include<string>

using namespace std;

int main()
{
string name, city, college, profession, animal_type, petname;
int age;

cout << "Enter name= ";
getline(cin, name);
cout << "Enter age= ";
cin >> age;
cin.ignore();//removes unuseful data remained in the buffer after allocating the "int" variable
cout << "Enter the city name= ";...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

Associative Arrays in C++
Homework Solution
$75.00
Programming
C++
Associative Arrays
Computer Science
Hash Tables
Chaining
Static Arrays
Game of Life
Records
Strings
Integers
Objects
Functions
Copying
Applet
Sequences
Lists
Prime Numbers
Simulations
C++ Problem: Integers Divisible By 3
Homework Solution
$10.00
Programming
C++
Computer Science
Integers
Division
Input
Output
Loops
Conditions
Mathematics
Modulus Operator
Get help from a qualified tutor
Live Chats