Posted: November 5th, 2022

Csc139 chapter 6 lab assignments

CSC139 Chapter 6 Lab Assignments

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Methods

 

Objectives

 

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

In this lab assignment, students will learn:

– How to define methods and functions

– How to call methods or functions

– How to specify parameters and how to pass arguments by value

 

Goals

 

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

– Define methods and functions

– Call methods or functions

– Specify parameters and pass arguments by value

 

Grading

 

– Design and create a GUI (20 pts)

– Create correct event handler methods (30 pts)

– Define and call methods or functions correctly (30 pts)

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

     In this lab assignment, you will create a “Gas Pump” application. A gas pump calculates the cost of gas based on the grade of gas. The station charges

$2.69 per gallon for Regular grade gas

$2.79 per gallon for Special grade gas

$2.89 per gallon for Super grade gas

 

Create a windows form application that simulates the functionality of the gas pump.

 

The user enters the number of gallons to purchase in a TextBox.

 

Click the desired grade button (each grade is represented by a Button whose Text properties are set to Regular, Special and Super).

 

The total cost will be calculated and displayed on the form.

 

In each Button’s Click event handler methods –

 

Read user’s input from TextBox.

Call a function to calculate total cost by passing number of gallons and grade of gas. The grade of gas can be retrieved from the Text property of each Button.

Display the total cost on the form.

Define a function to calculate total cost. This function

Requests the values of number of gallons and grade of gas (“Regular”, “Special” or “Super”).

Calculates total cost.

Returns the total cost.  

 

 

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Open chat
1
Order through WhatsApp!
affordablepaperwritings.com
Hello!
You Can Now Place your Order through WhatsApp

Order your essay today and save 30% with the discount code DISCOUNTS2022