Calculate with C++.
Calculate BMI
( Using Metric Measurements)
height: 152 centimeters=1.52meters
square of height: (1.52 x 1.52 )m2
= 2.31m2
weight:60 kilograms
BMI= weight= 60 = 25.96
height2 2.31
Adult (age>18)
Category BMI range - kg/m2
Severe Thinness < 16
Moderate Thinness 16 – 17
Mild Thinness 17 - 18.5
Normal 18.5 – 25
Overweight 25 – 30
Obese Class I 30 – 35
Obese Class II 35 – 40
Obese Class III > 40
Children (age 2-18)
Category Percentile Range
Underweight <5%
Healthy weight 5% - 85%
At risk of overweight 85% - 95%
Overweight >95%
If you have the
following expression:
(( A * (B + D)/E) - F * (G + H / K)))
Write C++ Program to convert infix
to postfix expression using the Stack Data Structure
Write a
function to insert a number into a sorted linked list. Assume the list is
sorted from smallest to largest value. After insertion, the list should still
be sorted. Given the list l1 = (3, 17, 18, 27) and the value 20, on return l1
be the list (3, 17, 18, 20, 27).
Write a
function to concatenate two linked lists. Given lists L1 = (2, 3, 1) and L2 =
(4, 5), after return from concatenate (L1, L2) the list L1 should be changed to
be L1 = (2, 3, 1, 4, 5). Your function should not change L2 and should not
directly link nodes from L1 to L2 (i.e., the nodes inserted into L1 should be
copies of the nodes from L2.).
Create a class named Laboratory containing • Two data fields i.e. name (a string) and location (string)
• A no-argument constructor to initialize all data fields with default values “NoName” and “NULL”
• A member function named input()
• A member function named show() to display the details associated with an instance of this class Lab 9 - Function Overloading and Function Overriding Capital University of Science and Technology, Islamabad Department of Computer Science (2020) Page 106 Derive a class named WetLab from class Laboratory that includes
• data members no_of_microscopes and Scientist_name,
• respective mutator and accessor functions • overriding function named input() to take input from user in all data members
• overriding function named show() to display the details associated with an instance of class WetLab From the Laboratory class, derive a class named DryLab that contain
• a data field named no_of_computers and Capacity • Setters and getters
Consider a class Fruit that contains o A data member named as Fruit Name of string type o A data member named as Quantity of type int o A data member named price-per-kg of type double o A member function displayprice(Fruit) that shows the price of the instrument while evaluating the name of the instrument object that it accepts as a reference parameter Derive two classes named Mango and Watermelon from the class Fruit that contain o A parameterized constructor to initialize data members that they inherit from the class Fruit
Suppose you are playing a killing game and have to kill few of your enemies. You are at a cliff and from there you can see few of them. You see the enemies at your height only. Therefore, you can only kill at the same height. The enemies are forming a balanced binary tree where their General is at the top of the other cliff, his two commanders are on the first level below him. The soldiers are at the lowest level. Total four soldiers are appointed. Under both the commanders exact two soldiers serve.
You have to make a strategy to kill the left commander first, than whoever takes his position kill him. Now start killing the right side with same strategy until only one enemy is left at left side. Now increase your height and kill the General. You can only win if only three of your enemies are left.
Display the enemies who are left and who have been killed. Don’t forget to print your victory message.
HINT: Balancing is the key to achieve your goal.
Write a program that will ask the user If he wants to enter a number. If the user will
enter “Y” then multiply all the numbers entered by user. The program will keep on
asking the user if he wants to enter a number until he enters “N”.
by CodeChum Admin
We've had enough about numbers, so why don’t we try evaluating characters now?
If you know how to identify what the vowel letters are, and you know how to count up to 5, then you’re good to go!
Instructions:
Input
Multiple lines containing a character on each. It is guaranteed that all the characters are in lower case format.
c
f
a
b
cOutput
Multiple lines containing a character on each.
c
f
aWrite a program in c# that will accept 10 numbers. The program will then compute and display the sum of the odd numbers and also even numbers separately