Java Black Paper Chart Chapter 9: 9.2 (STOCK Class) follows the example of the CIRLCE class in Section 9.2, and designed a class named Stock

tags: Java black paper after class questions  java

Java Black Paper Chart Chapter 9: 9.2 (STOCK Class) follows the example of the CIRLCE class in Section 9.2, and designed a class named Stock

topic

Code

Test2: Test program
Test2_stock: Implement the problem requirements

Test2

public class Test2 {
    public static void main(String[] args) {
        Test2_Stock s = new Test2_Stock("ORCL", "Oracle Corporation", 34.5, 34.35);
    }
}

Test2_Stock

public class Test2_Stock {
    String symbol;
    String name;
    double previousClosingPrice;
    double currentPrice;

    public Test2_Stock(String symbol, String name, double previousClosingPrice, double currentPrice){
        this.symbol = symbol;
        this.name = name;
        this.previousClosingPrice = previousClosingPrice;
        this.currentPrice = currentPrice;
        System.out.println((currentPrice - previousClosingPrice) / previousClosingPrice * 100 + "%");
    }
}

Uml diagram

Not uploading for the time being, it will be added in the future

Intelligent Recommendation

Java Black Book Post -Curriculum Topic Chapter 10:*10.10 (Queue class) Section 10.6 gives a Stock class. Design a class called Queue for storing integer. Like the stack, the queue saves elements. In the stack, the elements are first out. Elements in the queue are advanced first

10.10 (queue class) section 10.6 gives a stock class, designed a class called Queue for storage integer topic program Break the question Code Test10.java Test10_Queue.java topic program Test10.java: T...

QCUSTPLOT -9. Example -stock chart

1. Run screenshot 2. Source code...

Java Black Paper Chart Chapter 10:*10.11 (Geometric: CIRCLE2D) Definition CIRCLE2D class

*10.11 (geometric: Circle2D class) Definition Circle2D class topic program Code Test11.java Test11_Circle2D.java Run instance About UML topic program Test11.java: Test program Test11_circle2d.java: Co...

Java Black Paper After Class 10: 10.3 (Myinteger class) Design a class named Myinteger

10.3 (Myinteger class) Design a class called Myinteger topic Program description Code Test3.java Test3_MyInteger.java Running instance topic Program description Test procedure: Test3.java Construction...

Java Black Paper After Class 10: * 10.14 (MyDate class) Design a class named myDate

Black Book Programming Exercises 10.14 topic program Code Test14.java Test14_MyDate.java Test5.java run topic Supplement: The Gregoriancalendar class discussed to simplify programming program TEST14.J...

More Recommendation

Java Black Paper After Class Release Chapter 9: 9.7 (Account Class) Design a class named Account, which contains .... Write a test program, create an account ID of 1122, the balance is $ 20,000, an annual profit rate is 4.5% Account ...

9.7 (Account class) Design a class named Account topic Comic Code Test7 Test7_Account Results of the UML map topic Comic TEST7: Test Program TEST7_ACCOUNT: Implementation Title Requirements Code Test7...

Chapter 9 Dynamic Programming-1258: [Example 9.2] Digital Pyramid

1258: [Example 9.2] Digital Pyramid Time limit: 1000 ms Memory limit: 65536 KB Submissions: 12217 Passes: 6938 [topic description] Observe the digital pyramid below. Write a program to find the path f...

Class and object Design STOCK class

Class and object Design STOCK class Topic description 1. A string data named Symbol represents the stock code. 2. A string data domain named Name represents the stock name. 3. A Double Data named Prev...

a stock information query class

Today, a second friend asked me to help me write a stock query class to integrate into WeChat, so it took a little time to write an incomplete one. Haha, if anyone wants to play, you can continue to s...

1350 [BA1001] The Stock class

Description Provided Codes framework.cpp Submission source.h Standard Answer source.h...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top