Write a C++ Program that asks users to enter his or her weight and the name off
ID: 3659184 • Letter: W
Question
Write a C++ Program that asks users to enter his or her weight and the name off a planet. Make sure the code uses an enumerated type to represent the planet. The following table gives the factor by which the weight must be multipled for each planet. The program should output an error message if the user doesn't input a correct planet name. The prompt and the error message should make it clear to the user how a planet name should be enetered. Be sure to use proper formatting and appropriate comments in your code. The ouput should be labeled clearly and formatted neatly.Explanation / Answer
#include #include #include #include //after including the nccessery header files. main() {ff:clrscr(); char a[10][15]={"Mercury","Venus","Earth","Moon","Mars","Jupiter","Saturn","Uranus","Neptune","Pluto"}; float b[10] ={0.4155,0.8975,1.0,0.166,0.3507,2.5374,1.0677,0.8947,1.1794,0.0899}; float w; char nam[7]; int k; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.