Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Overview For this assignment, write a C + + program to calculate and display the gravitational force between two objects. Basic Program Logic The first

Overview
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.)
Ask the user of the program for the mass (in kilograms) of the first object. This value should be saved in a float or double variable.
Ask the user of the program for the mass (in kilograms) of the second object. This value should be saved in a float or double variable.
Ask the user of the program for the distance (in meters) between the two objects. This value should be saved in a float or double variable.
Use the three variables from above to calculate the gravitational force between the two objects (formula follows). Depending on how the code is written, if the calculated gravitational force is saved in a variable, it should be type float or double.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Office 365 For Beginners 2022 8 In 1

Authors: James Holler

1st Edition

B0B2WRC1RX, 979-8833565759

More Books

Students also viewed these Databases questions

Question

3. Identify cultural universals in nonverbal communication.

Answered: 1 week ago

Question

2. Discuss the types of messages that are communicated nonverbally.

Answered: 1 week ago