Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for C++ using if and else statements only. Write a program that asks the user for its weight (in pounds, may be decimal)

This is for C++ using "if" and "else" statements only. image text in transcribed

Write a program that asks the user for its weight (in pounds, may be decimal) and height (in inches, may be decimal) and determines the best position for him in a rugby team, using the following guidelines: A player weighing less than 160lbs is either a half-back, a wing, or a full-back. The smaller players (less than 68in) should be half-backs; the taller (over 75in) should be full- backs; the rest shall play wings. Between 160lbs (excluded) and 190 lbs (included) are the centers, regardless of their height. Above 190 lbs (strictly), but less than 220 lbs are the back-row. Players above 220lbs (strictly) but not above 250lbs and taller than 77in are the locks. The front-row is made of players above 220lbs (strictly) who are too short or too heavy to play as a lock. The prompts should be "Enter your weight:" and "Enter your height:"(in that order). The output should be one of the following: front-row, lock, back-row, half- back, center, wing, full-back. For example if the inputs are 240 and 79, the output should be lock. If the inputs are 160 and 68.5, the output should be wing. Sample output1: Enter your weight: 240 Enter your height: 79 lock Sample output2: Enter your weight: 160 Enter your height: 68.5 wing Submit file name: rugby.cpp

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

Accounting For Small Business 2023

Authors: Martin J. Kallman

1st Edition

180171925X, 978-1801719254

Students also viewed these Databases questions