Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class PrintAndSum_04 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- //време за един епизод с реклами = епизод + реклами (20% oт епизод)
- //доп. време от спец. епизоди = бр. сезони * 10
- //общо време = сезони * бр. епизоди за сезон * време за един епизод с реклами + доп. време от спец. епизоди
- String seriesName = scanner.nextLine();
- int seasons = Integer.parseInt(scanner.nextLine());
- int episodes = Integer.parseInt(scanner.nextLine());
- double timeForEpisode = Double.parseDouble(scanner.nextLine());
- double totalTimeEpisode = timeForEpisode + 0.2 * timeForEpisode;
- int additionalTime = seasons * 10;
- double totalTime = (seasons * episodes * totalTimeEpisode) + additionalTime;
- System.out.printf("Total time needed to watch the %s series is %.0f minutes.", seriesName, Math.floor(totalTime));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment