Create a “Gas Price” Windows Form Application

profileTopsolutions
 (Not rated)
 (Not rated)
Chat

CSC139 Chapter 7 Lab Assignments

Arrays

 

 

Objectives

 

In this lab assignment, students will learn:

- How to declare and initialize array

- How to save/retrieve data in/from array

- How to find the highest and lowest value from array

- How find sum and average value of an array

 

Goals

 

In this lab assignment, students will demonstrate the abilities to:

- Declare and initialize array

- Save/retrieve data in/from array

- Find the highest and lowest value from array

- Find sum and average value of an array

 

Grading

 

- Design and create a GUI (20 pts)

- Create correct event handler methods (30 pts)

- Create and use array correctly (30 pts)

- The program can be compiled and executed without error (20 pts)

 

Create a “Gas Price” Windows Form Application, here is the sample input/output:           

 

     

 

 

Ø  Allow user to enter gas prices for 12 month from the textbox and click the Enter button.

Ø  Create a 12 element 1-dimensional array of Decimal type

Ø  Store the prices in the array, and get price from the array, display in the listbox immediately.

Ø  When click “Get Highest Price” button, iterate the elements in the array and find the highest price and its month.

Ø  When click “Get Lowest Price” button, iterate the elements in the array and find the lowest price and its month.

Ø  When click “Get Average Price” button, iterate the elements in the array and find the average price.

Ø  Display results on the form.

 

 

    • 12 years ago
    complete solution
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      gas_prices_app.zip