GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Algorithms-Java/src/Case7.java at master · professorDeveloper/Algorithms-Java

Expand file tree

/

Case7.java

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
34 lines (31 loc) · 1.2 KB
/

Case7.java

Copy path

File metadata and controls

34 lines (31 loc) · 1.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.util.Scanner;
public class Case7 {
// berilgan
// og'irlik
// birlik
// kg ga o'tkazilsin
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double weight;
int birlik;
System.out.println("Kg ga convert");
System.out.println("w = ");
weight = scanner.nextDouble(); //12.5
System.out.println("Birlikni tanlang");
System.out.println("1:kg 2:mg, 3:gr, 4:tn 5:sr ");
birlik = scanner.nextInt();
// 1. kg 2.mg, 3.gr, 4.tn 5.sr
switch (birlik) {
case 1 -> // kg
System.out.printf("%f(kg) -> %f(kg)", weight, weight);
case 2 -> // mg 1kg = 1000000 mg
System.out.printf("%f(mg) -> %f(kg)", weight, (weight / 1_000_000L));
case 3 -> // gr 1kg = 1000 gr
System.out.printf("%f(gr) -> %f(kg)", weight, (weight / 1_000L));
case 4 -> // tn 1tn = 1000 kg
System.out.printf("%f(tn) -> %f(kg)", weight, weight * 1000);
case 5 -> // sr 1sr = 100 kg
System.out.printf("%f(sr) -> %f(kg)", weight, weight * 100);
}
}
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.