0% found this document useful (0 votes)
24 views8 pages

Batch 2 Day 2 Assignment

The document outlines two programming problems: calculating restaurant bills based on product prices and tax percentage, and converting height from feet and inches to centimeters and weight from kilograms to pounds. It provides sample inputs and outputs for each problem to illustrate the expected results. Additionally, it includes links to related video resources and encourages joining a community for further engagement.

Uploaded by

leonardmark017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views8 pages

Batch 2 Day 2 Assignment

The document outlines two programming problems: calculating restaurant bills based on product prices and tax percentage, and converting height from feet and inches to centimeters and weight from kilograms to pounds. It provides sample inputs and outputs for each problem to illustrate the expected results. Additionally, it includes links to related video resources and encourages joining a community for further engagement.

Uploaded by

leonardmark017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

#JavaFundamentals

#Day2 #Problem 1
Calculate Restaurant
Bill
Problem 1:Calculate Restaurant Bills

▪ Write a program to consider the price of the 3 product for the


restaurant bill and the tax percentage and calculate final amount.
▪ Assume that the price of the all the 3 product and the tax percentage
will also be positive.
▪ Handle the decimal values
!"# $%&'%(!")%
▪ Tax amount = *++
! "#$%&'( "#)'*

Nest4Code
Problem 1:Calculate Restaurant Bills

Sample Input/Output 1: Sample Input/Output 2:


Input: Price 1: 15.5
price 1: 70 Price 2: 4.5
Price 3: 30
price 2: 20
tax %: 5
price 3: 10 Output:
tax %: 18 Final Amount : 52.5
Output:
Final Amount: 118.0

Nest4Code
#JavaFundamentals
#Day2 Problem 2
Height and Weight
Convertor
Problem 2:Height and Weight Convertor

▪ At Few places, heights are considered in feet and inches and weight
in kg, we need to solve this problem and get the height in cm and
weight in pounds.
▪ Define the feet and inch part of the height and weight in the kg.
Handle the decimal values for results, input will always will be
integer.
▪ Hint: One foot is 12 inch and 1inch is 2.54cm. One kg is 2.2 pounds

Nest4Code
Problem 2: Height and Weight Convertor

Sample Input/Output 1: Sample Input/Output 2:


Input: Sample Input/Output 1:
Feet: 5 Input:
Feet: 5
Inch: 11
Inch: 0
Kg : 60 Kg: 101

Output: Output:
Height in cm 180.34 Height in cm 152.4
Weight in pounds: 132 Weight in pounds: 222.2

Nest4Code
Problem 1 & 2: Topic for the Problem

Please refer to the below topic video:


▪ Day 1: https://youtu.be/-VsD6mFBXgs
▪ Day 2: https://youtu.be/WB3cQ2Plpg0

Nest4Code
Happy Coding J
Don’t forget to Join us and be a part of
community.
Website: https://nest4code.in
Youtube: https://youtube.com/c/nest4code
Instagram: https://instagram.com/nest4code
Telegram: https://t.me/nest4code
Facebook: http://bit.ly/fbnest4code

You might also like