Using Python to Solve Java Problems | Solving Chapter 1 Exercise 17
Solving another Java Programming exercise using Python.
Source:
Java Programming: From Problem Analysis to Program Design 5th Edition
by: D.S. Malik
The Problem:
Chapter One Exercise Seventeen p. 24
Suppose that the cost of sending an international fax is calculated as follows:
Service charges $3.00, $0.20 per page for the first 10 pages, and $0.10 for each additional page. Design an algorithm that asks the user to enter the number of pages to be faxed. The algorithm then uses the number of pages to be faxed to calculate the amount due
The Algorithm:
Step 1: Ask user for number of pages to fax
Step 2: Determine if number of pages is more than 10.
If it is greater than 10
amount due = 10 * 0.20
amount due = amount due + ((number of pages - 10) * 0.10)
amount due = amount due + 3.00 service charge
Otherwise
amount due = number of pages * 0.20
amount due = amount due + 3.00 service charge
Step 3: Print details of transaction (assuming user typed 15)
Number of pages : 15
First 10 pages : $2.00
Rest of pages : $0.50
Service Charge : $3.00
Total Amount Due : $5.50
Step 4: Done.
I hope you learned from this video. If you have any suggestions, questions, or clarifications, please leave your comments below.
And don't forget to subscribe to get updated with the next videos in this series.
Music Credit: See You On The Otherside - The 126ers
https://www.youtube.com/channel/UCep47rkC_STH4BdGVUTeMnw
#python #intermediate #programming #java #computerprogramming
#calculatefaxcharges
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Using Python to Solve Java Problems | Solving Chapter 1 Exercise 17», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.