Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ProgammingBasics;
- import java.util.Scanner;
- public class ProjectPrizeExam {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int typesOfProject = Integer.parseInt(scanner.nextLine());
- double moneyForOnePoint = Double.parseDouble(scanner.nextLine());
- int totalPoints = 0;
- while (typesOfProject > 0) {
- int points = Integer.parseInt(scanner.nextLine());
- if (typesOfProject % 2 == 0) {
- points = points * 2;
- }
- totalPoints += points;
- typesOfProject--;
- }
- double projectPrize = totalPoints * moneyForOnePoint;
- System.out.printf("The project prize was %.2f lv.", projectPrize);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment