Find Jobs
Hire Freelancers

Java Fraction Program

$30-250 USD

Tamamlandı
İlan edilme: 11 yıldan fazla önce

$30-250 USD

Teslimde ödenir
The files must be called <LastNameFirstNameProg7.java>. (driver) [login to view URL] (handles the fractional numbers) Example: [login to view URL] [login to view URL] Ensure you include ALL files required to make your program compile and run. I would like to see your .java files only. Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter. Basic Requirements Write a driver and fraction class that performs addition, multiplication, prints the fraction, and prints as a double. [login to view URL] Provide a driver class, LastNameFirstNameProg7, that demonstrates this Fraction class. The driver class should contain this main method: public static void main(String[] args) { Scanner stdIn = new Scanner([login to view URL]); Fraction c, d, x; // Fraction objects [login to view URL]("Enter numerator; then denominator."); c = new Fraction([login to view URL](), [login to view URL]()); [login to view URL](); [login to view URL]("Enter numerator; then denominator."); d = new Fraction([login to view URL](), [login to view URL]()); [login to view URL](); x = new Fraction(); // create a fraction for number 0 [login to view URL]("Sum:"); [login to view URL](c).add(d); [login to view URL](); [login to view URL](); x = new Fraction(1, 1); // create a fraction for number 1 [login to view URL]("Product:"); [login to view URL](c).multiply(d); [login to view URL](); [login to view URL](); [login to view URL]("Enter numerator; then denominator."); x = new Fraction([login to view URL](), [login to view URL]()); [login to view URL](); } // end main Note that this demonstration driver does not call the accessor methods. That’s OK. Accessor methods are often implemented regardless of whether there’s an immediate need for them. That’s because they are very useful methods in general and providing them means that future code can use them when the need arises. [login to view URL] Write a Fraction class called [login to view URL] that implements these methods: add ? This method receives a Fraction parameter and adds the parameter fraction to the calling object fraction. multiply ? This method receives a Fraction parameter and multiplies the parameter fraction by the calling object fraction. print ? This method prints the fraction using fraction notation (1/4, 21/14, etc.) printAsDouble ? This method prints the fraction as a double (0.25, 1.5, etc.) Separate accessor methods for each instance variable in the Fraction class. Sample Output Enter numerator; then denominator. 5 8 5/8 Enter numerator; then denominator. 4 10 4/10 Sum: 82/80 1.025 Product: 20/80 0.25 Enter numerator; then denominator. 6 0 infinity
Proje No: 2535946

Proje hakkında

4 teklif
Uzaktan proje
Son aktiviteden bu yana geçen zaman 12 yıl önce

Biraz para mı kazanmak istiyorsunuz?

Freelancer'da teklif vermenin faydaları

Bütçenizi ve zaman çerçevenizi belirleyin
Çalışmanız için ödeme alın
Teklifinizin ana hatlarını belirleyin
Kaydolmak ve işlere teklif vermek ücretsizdir
Seçilen:
Kullanıcı Avatarı
Hi, I'd like to do this project please.
$30 USD 0 gün içinde
4,9 (1157 değerlendirme)
7,6
7,6
4 freelancer bu proje için ortalama $35 USD teklif veriyor
Kullanıcı Avatarı
Hi, I am expert at Java and can surely satisfy you. Please check your inbox,
$30 USD 0 gün içinde
5,0 (107 değerlendirme)
6,3
6,3
Kullanıcı Avatarı
Hello, an expert Java programmer here and ready to start.
$50 USD 1 gün içinde
5,0 (34 değerlendirme)
5,1
5,1
Kullanıcı Avatarı
Hello, we are experts in Java and can complete this task within an hour. Kindly check PMB.
$30 USD 0 gün içinde
4,4 (19 değerlendirme)
4,4
4,4

Müşteri hakkında

   UNITED STATES bayrağı
San Antonio, United States
5,0
9
Ödeme yöntemi onaylandı
Eki 4, 2012 tarihinden bu yana üye

Müşteri Doğrulaması

Teşekkürler! Ücretsiz kredinizi talep etmeniz için size bir bağlantı gönderdik.
E-postanız gönderilirken bir şeyler yanlış gitti. Lütfen tekrar deneyin.
Kayıtlı Kullanıcı İlan Edlien Toplam İş
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ön izleme yükleniyor
Coğrafik konum için izin verildi.
Giriş oturumunuzun süresi doldu ve çıkış yaptınız. Lütfen tekrar giriş yapın.