desislava_topuzakova

07. Projects Creation

Jan 8th, 2022
1,302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class ProjectsCreation {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         //вход: ред 1: име, ред 2: брой проекти
  8.         //необходими часове = брой проекти * 3
  9.         //изход
  10.         String name = scanner.nextLine();
  11.         int countProjects = Integer.parseInt(scanner.nextLine());
  12.         int needHours = countProjects * 3;
  13.         //string -> %s
  14.         //double -> %f
  15.         //int -> %d
  16.         //"The architect {името на архитекта} will need {необходими часове} hours to complete {брой на проектите} project/s."
  17.         System.out.printf("The architect %s will need %d hours to complete %d project/s.", name, needHours, countProjects);
  18.  
  19.  
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment