Starting out with Visual C# (4th Edition)
Starting out with Visual C# (4th Edition)
4th Edition
ISBN: 9780134382609
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 4, Problem 8PP

Body Mass Index Program Enhancement

In Programming Problem 6 in Chapter 3, you were asked to create an application that calculates a person’s body mass index (BMI). Recall from that exercise that the BMI is often used to determine whether a person is overweight or underweight for their height. A person’s BMI is calculated with the following formula:

B M I = W e i g h t × 703 ÷ H e i g h t 2

In the formula, weight is measured in pounds and height is measured in inches. Enhance the program so it displays a message indicating whether the person has optimal weight, is underweight, or is overweight. A person’s weight is considered to be optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is considered to be underweight. If the BMI value is greater than 25, the person is considered to be overweight.

Blurred answer
Students have asked these similar questions
Circle Properties Write a program that prompts for and accepts the diameter of a circle as a floating point number. The program should calculate and output the area and circumference of the circle. A sample run of the program should look like this: Enter circle diameter: 2.5 The area is 4.91 and the circumference is 7.85.   Use 3.14159 as your constant for pi.     global main       ; exposes program entry point to the linkerextern printf   ; declare external functionextern scanf section .text   ; start of code segment main:   push rbp               ; preserve base pointer   mov rbp,rsp               ; copy stack pointer to base pointer    pop       rbp               ; restore base pointer   mov       rax, 0           ; exit status (0 = success)   ret section .data   ; start of initialized data segment section .bss   ; start of uninitialized data segment section .dataprompt db "Enter circle diameter: ", 0format db "The area is %0.2f and the circumference is %0.2f.", 0pi dq 3.14159…
Assignment Description This program will simulate part of the game of Yahtzee! This is a dice game that involves rolling five dice and scoring points based on what show up on those five dice. The players would record their scores on a score card, and then total them up, and the player with the larger total wins the game. A Yahtzee score card has two portions: The upper portion has spaces for six scores, obtained by adding up all of the 1's, 2's, 3's, etc. The lower portion has special scores for various combinations: Three of a kind -- at least 3 dice are the same number;the score is the sum of all five dice Four of a kind -- at least 4 dice are the same number;the score is the sum of all five dice Small straight -- four consecutive numbers are represented, e.g. 2345;the score is 25 points Large straight -- five consecutive numbers are represented, e.g. 23456;the score is 30 points Full House -- three of one kind, two of another; the score is 30 points Yahtzee! -- five of a kind; the…
Rock, Paper, Scissors Game Create a application using (C#) in Microsoft Visual Studio that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you use clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules: •If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)•If one player chooses scissors and the other player chooses paper, then scissors wins.…

Chapter 4 Solutions

Starting out with Visual C# (4th Edition)

Ch. 4.3 - Convert the following set of nested if-else...Ch. 4.4 - Prob. 4.12CPCh. 4.4 - Prob. 4.13CPCh. 4.4 - Assume the variables a = 2, b = 4, and c = 6....Ch. 4.4 - Explain how short-circuit evaluation works with...Ch. 4.4 - Write an if statement that displays the message...Ch. 4.4 - Write an if statement that displays the message...Ch. 4.5 - Prob. 4.18CPCh. 4.5 - Prob. 4.19CPCh. 4.6 - If the following code were part of a complete...Ch. 4.6 - If the following code were part of a complete...Ch. 4.7 - Prob. 4.22CPCh. 4.7 - If a TryParse method successfully converts the...Ch. 4.7 - Prob. 4.24CPCh. 4.7 - Prob. 4.25CPCh. 4.9 - Prob. 4.26CPCh. 4.9 - If several CheckBox controls have been created in...Ch. 4.9 - Prob. 4.28CPCh. 4.10 - Convert the following if-else-if code to a switch...Ch. 4.11 - Prob. 4.30CPCh. 4.11 - Prob. 4.31CPCh. 4.11 - Prob. 4.32CPCh. 4 - A __________ structure executes a set of...Ch. 4 - A __________ structure provides one alternative...Ch. 4 - A(n) __________ expression has a value of either...Ch. 4 - The symbols , , and == are all __________...Ch. 4 - A __________ structure tests a condition and then...Ch. 4 - You use a(n) __________ statement to write a...Ch. 4 - You use a(n) __________ statement to write a dual...Ch. 4 - A ____________ decision structure is written...Ch. 4 - , ||, and ! are __________ operators. a....Ch. 4 - A compound Boolean expression created with the...Ch. 4 - A compound Boolean expression created with the...Ch. 4 - The __________ operator takes a Boolean expression...Ch. 4 - A __________ is a Boolean variable that signals...Ch. 4 - Prob. 14MCCh. 4 - Prob. 15MCCh. 4 - Prob. 16MCCh. 4 - The __________ section of a switch statement is...Ch. 4 - A ListBoxs index numbering starts at __________....Ch. 4 - You can use the __________ property to determine...Ch. 4 - The __________ property holds the item that is...Ch. 4 - Prob. 1TFCh. 4 - A single-alternative decision structure tests a...Ch. 4 - The if-else statement is a dual-alternative...Ch. 4 - A decision structure can be nested inside another...Ch. 4 - A compound Boolean expression created with the ...Ch. 4 - Prob. 6TFCh. 4 - Multiple CheckBox controls in the same GroupBox...Ch. 4 - The test expression in a switch statement can be a...Ch. 4 - If an item is not selected in a ListBox, the...Ch. 4 - Prob. 10TFCh. 4 - What is meant by the term conditionally executed?Ch. 4 - You need to test a condition and then execute one...Ch. 4 - Briefly describe how the operator works.Ch. 4 - Briefly describe how the || operator works.Ch. 4 - Prob. 5SACh. 4 - What is a flag and how does it work?Ch. 4 - What are the two arguments that you pass to a...Ch. 4 - How do you determine in code whether a RadioButton...Ch. 4 - Prob. 9SACh. 4 - Prob. 10SACh. 4 - Write an if statement that assigns 20 to the...Ch. 4 - Write an if statement that assigns 0 to the...Ch. 4 - Write an if-else statement that assigns 0 to the...Ch. 4 - Write nested decision structures that perform the...Ch. 4 - Write an if-else statement that displays Speed is...Ch. 4 - Write an if-else statement that determines whether...Ch. 4 - Prob. 7AWCh. 4 - Rewrite the following if-else-if statement as a...Ch. 4 - Prob. 9AWCh. 4 - Roman Numeral Converter Create an application that...Ch. 4 - Mass and Weight Scientists measure an objects mass...Ch. 4 - Magic Dates The date June 10, 1960, is special...Ch. 4 - Color Mixer The colors red, blue, and yellow are...Ch. 4 - Prob. 5PPCh. 4 - Book Club Points Serendipity Booksellers has a...Ch. 4 - Software Sales A software company sells a package...Ch. 4 - Body Mass Index Program Enhancement In Programming...Ch. 4 - Change for a Dollar Game Create a change-counting...Ch. 4 - Fat Percentage Calculator One gram of fat has 9...Ch. 4 - Time Calculator Create an application that lets...Ch. 4 - Workshop Selector The following table shows a...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
In Exercise 2.79 you were asked to investigate (among other things) the expressions Predict, and then test, ...

Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)

What three things are listed on an IPO chart?

Starting Out with Python (3rd Edition)

The ____________ is always transparent.

Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)

A(n) _______ variable is defined inside a function and is not accessible outside the function.

Starting Out with C++ from Control Structures to Objects (8th Edition)

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY