Question

In: Computer Science

32. Write a proper decision structure that checks the following conditions and if both conditions are...

32. Write a proper decision structure that checks the following conditions and if both conditions are correct ,sets the value of the “Qualification’’ variable equal to True, if any of the conditions does not hold, set the value equal to False.  

Bool Qualification;

Condition1: Age Must be Greater than or equal to 21

Condition2: Weight Must be Greater than 190 lbs.

USING C#

Solutions

Expert Solution

C# code:

using System;
class Qualification {
static void Main() {
//initializing Qualification as true
bool Qualification=true;
//accepting age
int age=Convert.ToInt32(Console.ReadLine());
//accepting weight
int weight=Convert.ToInt32(Console.ReadLine());
//checking if age is less than 21 or weight is less than or equal to 190
if(age<21 || weight<=190)
//setting Qualification as false
Qualification=false;
//printing Qualification
Console.WriteLine(Qualification);
}
}

Screenshot:


Input and Output:


Related Solutions

Write a program that uses a structure to store the following data: (Remember to use proper...
Write a program that uses a structure to store the following data: (Remember to use proper formatting and code documentation) Member Name Description name student name idnum Student ID number Scores [NUM_TESTS] an array of test scores Average Average test score Grade Course grade Declare a global const directly above the struct declaration const int NUM_TESTS = 4; //a global constant The program should ask the user how many students there are and should then dynamically allocate an array of...
C++ - Checks the relevance of a data structure in terms of following the interface specification...
C++ - Checks the relevance of a data structure in terms of following the interface specification for an ADT that represents a linear data structure: Depending on the ADT of linear data structure, you must create the operations CRUD (Create, Read (search), Update, Delete) elements in the data structure. Some operations do not apply for certain data structures Create: Description: Insert an element in the data structure (create) according to the access policy of the structure Input:Data structure and element...
Write a 2-page paper describing the importance to decision making of proper overhead allocation. Discuss the...
Write a 2-page paper describing the importance to decision making of proper overhead allocation. Discuss the various methods available to accountants to allocate overhead to products and services. Include the limitations of these methods as well as the pros and cons for each method.
THIS IS FOR ARDUINO PROGRAMMING Write code that checks the sensor data and meets the following...
THIS IS FOR ARDUINO PROGRAMMING Write code that checks the sensor data and meets the following conditions: For night conditions, turn on white LED 1 For day conditions, turn off white LED 1 Code should check intervals every 5 seconds. NEED THE BELOW CODE TO FIT THE ABOVE REQUIREMENTS. const int lightSensor = 5; //light sensor variable float sensValue = 0; //variable to hold sensor readings const int button = 3; //pin for button reads const int LED1 = 5;...
Create a structure/frame of an introduction, thesis, supporting evidence, analysis, and proper context for the following...
Create a structure/frame of an introduction, thesis, supporting evidence, analysis, and proper context for the following questions. 3. What were the factors that contributed to the Great Depression? - How did the New Deal change society and the relationship between citizen and government? - What specific reforms did FDR pass to make sure that another Great Depression did not occur?
Assess the following argument by analogy: Go through each of the 3 checks, and then write...
Assess the following argument by analogy: Go through each of the 3 checks, and then write your conclusion about the analogy (strong or weak). Check #1: Specify exactly what is being compared Check #2: List several similarities (both of the objects/events/ideas compared have a, b, and c). Check #3: Find at least 1 key difference if you can (the objects/events/ideas compared are different in d or in e). This is a matter of quality, not quantity Is this weak or...
Write the Lewis structure for the following molecules
Answer the following involving the Lewis structure: Write the Lewis structure for the following molecules Hydroxylamine (NH3O) Hydrazine N2H4   Draw the Lewis structures for all the important resonance form of NO-2. The following structures do not obey the octet rule. Draw a Lewis structure for each and state the type of octet-rule exception. 1. PF-62. XeF23. BH3   Draw the Lewis structure with lowest formal charges, and determine the charge on each atom in OCS.
*Code in C* Write a function that checks if a number is a perfect cube. Write...
*Code in C* Write a function that checks if a number is a perfect cube. Write another function that calculates the integer cubic root. Under the main program: Prompt the user to input a number Tell the user if the number is a perfect cube or not Print the cubic root if the inputted number is a perfect cube.
2)    Complete T-Accounts. Proper entries and proper formatting will both be marked. a) Prepare T-Accounts...
2)    Complete T-Accounts. Proper entries and proper formatting will both be marked. a) Prepare T-Accounts only for the following entries.                                                                        Bad Debt Expense      500                         ADA                            500             COGS                         400                         Inventory                     400      b)    Prepare T-Accounts to reflect the entries used to close any of the above balances in the accounts in part a) as required, include the creation of the required interim account used to close out accounts, and the subsequent closing of that account....
Create frame/structure of an introduction, thesis, evidence, analysis, proper context for the following questions. 1. Explain...
Create frame/structure of an introduction, thesis, evidence, analysis, proper context for the following questions. 1. Explain the origins and major events of WWII: - How did the USA get involved in the war? - What impact did the war have on the economy, race relations? - How did the war end?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT