Package Tugas.docx

  • Uploaded by: Nadya Merdeka
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Package Tugas.docx as PDF for free.

More details

  • Words: 109
  • Pages: 2
NAMA: NADYA MERDEKA WATI NPM: 1715061010 PEMROGRAMAN BERORIENTASI OBJEK (PBO)

10. Write a program that does the reverse of Exercise 9, that is, input degrees Fahrenheit and prints out the temperature in degrees Celsius. The formula to convert degrees Fahrenheit to equivalent degrees Celsius is

ANSWER 1. Source code package tugas; import java.util.*; public class Tugas { public static void main(String[] args) { Scanner suhu = new Scanner(System.in); double fahrenheit,celcius;

System.out.print("Enter the temperature in Fahrenheit: "); fahrenheit = suhu.nextDouble();

celcius = (fahrenheit-32)*5/9; System.out.print(fahrenheit + " " + "degrees Fahrenheit is equivalent with " + celcius + " " + "degrees Fahrenheit"); suhu.close(); } }

SCREENSHOOT Source Code

Output program

Related Documents

Package
November 2019 84
Package)
June 2020 44
Package
May 2020 56
Package
October 2019 55
Qvi-package
June 2020 2
Invitation Package
November 2019 14

More Documents from ""

Materi Arduino 4.pdf
May 2020 14
Log Book 2.docx
May 2020 25
Package Tugas.docx
May 2020 12
Mncgroup.docx
November 2019 35
Morning Report.docx
April 2020 21