Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Lab Assignments

Methods

Objectives

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

- Design and create a GUI
- Create correct event handler methods
- Define and call methods or functions correctly
- The program can be compiled and executed without error

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92063580
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question after reviewing the assigned reading materials

Question: After reviewing the assigned reading materials, complete the following activities: 1. Develop a product service idea. A. Describe the product/service including the benefits of using the product/service B. Discu ...

Fifteen batteries are tested to determine whether the

Fifteen batteries are tested to determine whether the battery life is as long as advertised. Four batteries fail the test. From all fifteen batteries, two are selected at random without replacement. Find the probability ...

Sorted array insertiona implement the fastest possible

Sorted Array Insertion a) Implement the fastest possible algorithm to insert a new entry into a sorted (in ascending order) array of strings. Duplicates are NOT allowed - throw an IllegalArgumentException if a duplicate ...

Question overview of information security and risk

Question: Overview of Information Security and Risk Management (Due Oct 24) Does your company (or school) have a current disaster recovery plan? What are some of the activities involved in it? Do you feel confident that ...

The big bad wolf loves eating little pigs for breakfast

The big bad wolf loves eating little pigs for breakfast, lunch, dinner, supper, midnight snacks and he does know all about second breakfast. He tends to consume a lot of little pigs in a week. (He is probably not Jewish) ...

We can represent a data set as a collection of object nodes

We can represent a data set as a collection of object nodes and a collection of attribute nodes, where there is a link between each object and each attribute, and where the weight of that link is the value of the object ...

Whats the relationship between organizational performance

What's the relationship between organizational performance and financial management practices. These include capital structure decision, investment appraisal techniques, dividend policy, working capital management and fi ...

Recall that a floating-point number can be expressed as-1s

Recall that a floating-point number can be expressed as (-1) s (1 + f) 2 e where s, f and e are binary numbers. Recall that s is the sign indicator, f the mantissa (or fractional part), and e the exponent. Suppose the si ...

When talking about economics and the history of it for the

When talking about Economics and the history of it. For the past recessions the U.S. has had, do we look at it mostly on the loan side of the banks or what causes most recessions?

Decision support systems dss what sorts of dss tools do you

Decision support systems (DSS). What sorts of DSS tools do you use at your work - e.g., what-if analysis, sensitivity analysis, scenario analysis, goal-seeking analysis, optimization analysis, etc.? Even if you don't use ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As