Question

For this assignment, write a C++ program to calculate and display the gravitational force between two objects. Basic Program Logic: The first thing to do in the program is to create any variables that are needed to hold/save information for the program. To determine how many variables are needed, think about the information that will be entered by someone using the program and whether it is important for that information to be saved. Think about any calculations that will be performed by the program and whether the results of the calculations need to be saved. To determine the data type for the variables, think about what values someone using the program will be entering or what kind of results will be produced by any calculations. (Note: to ease into writing this first program, the data type for the variables has been specified below.)

          For this assignment, write a C++ program to calculate and display the gravitational force between two objects.

Basic Program Logic:
The first thing to do in the program is to create any variables that are needed to hold/save information for the program. To determine how many variables are needed, think about the information that will be entered by someone using the program and whether it is important for that information to be saved. Think about any calculations that will be performed by the program and whether the results of the calculations need to be saved. To determine the data type for the variables, think about what values someone using the program will be entering or what kind of results will be produced by any calculations. (Note: to ease into writing this first program, the data type for the variables has been specified below.)
        
Show more…

Added by Donald W.

Computer Science and Information Technology
Computer Science and Information Technology
Trishna Knowledge Systems 2018 Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
For this assignment, write a C++ program to calculate and display the gravitational force between two objects. Basic Program Logic: The first thing to do in the program is to create any variables that are needed to hold/save information for the program. To determine how many variables are needed, think about the information that will be entered by someone using the program and whether it is important for that information to be saved. Think about any calculations that will be performed by the program and whether the results of the calculations need to be saved. To determine the data type for the variables, think about what values someone using the program will be entering or what kind of results will be produced by any calculations. (Note: to ease into writing this first program, the data type for the variables has been specified below.)
Close icon
Play audio
Feedback
Powered by NumerAI
Jennifer Stoner Danielle Fairburn
Kathleen Carty verified

Akash M and 73 other subject AP CS educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
problem-create-a-program-to-calculate-to-calculate-the-weight-of-a-person-on-another-planet-the-person-should-enter-hisher-weight-on-earth-and-select-a-planet-because-there-are-multiple-plan-66429

Problem: Create a program to calculate the weight of a person on another planet. The person should enter his/her weight on earth and select a planet. Because there are multiple planets that begin with the same name, you will probably want the user to enter something like 1 for Mercury, 2 for Venus, 3 for Earth, etc. Below are the conversion factors the planets in the solar system, as well as for Pluto and the moon: Mercury Venus Earth Mars Moon Jupiter Saturn Uranus Neptune Pluto 0.4155 0.8975 1.0 0.3507 0.166 2.5374 1.0677 0.8947 1.1794 0.0899 Use a while loop to confirm that the user enters a correct choice for the planet, and another while loop to confirm that the user enters a valid weight. Use a switch to assign the conversion factor and the planet name to appropriate variables. Calculation and output of the message should occur after the switch structure is complete. No ifs (or else ifs) should appear in your code.

Akash M.

using-fortran-scientific-programming-language-i-want-you-to-design-a-program-that-is-able-to-calculate-the-quadratic-formula-using-fortran-scientific-programming-languagei-want-you-to-design-58042

Akash M.

write-a-c-program-that-reads-the-users-weight-on-earth-then-use-gravity-value-of-other-planets-to-calculate-and-print-their-weight-on-each-planet-including-the-moon-33025

Write a C++ Program that reads the user's weight on Earth, then use gravity value of other planets to calculate and print their weight on each planet, including the moon.

Shelayah R.


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

Trishna Knowledge Systems 2018 Edition
achievement 1,007 solutions
Introduction to Programming Using Python

Introduction to Programming Using Python

Y. Daniel Liang 1st Edition
achievement 1,867 solutions
Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow 12th Edition
achievement 1,786 solutions

*

Transcript

-
00:01 Hi to everyone, so the code is def men conversion factor equals to 0 .4 1 double 5 0 point 8 9 7 5 1 point 0 0 point 3 0 3 5 0 7 0 point 1 6 6 2 point 5 3 7 4 1 point 0 0 6 7 7 0 point 8 9 4 7 1 point 1 7 9 4 0 point 0 8 9 9 while true try wait on earth float input interior weight on earth in kilogram choice int input select planet 1 to 10 if 1 twice and break expected value print invalid input please try again now wait on planet wait on earth into conversion factor twice one now print your weight on planet twice is weight on planet point to a kilogram if name mean so this is the answer that's all...
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever