Purchase Solution

Creating C# and Java Programs: Example Application Problems

Not what you're looking for?

Ask Custom Question

Problem 1:

a. Design and implement a C# program that will gather floating point numbers and determine the sum and average of the data entered. The program should use separate methods for inputting the data, calculating the sum, calculating the average, and displaying the results. A sentinel value should be used to indicate the user has completed entering their numbers. The output should display a message that includes the count of the numbers entered, the sum of the numbers and the average of the numbers. If the sum of the numbers is greater than 100, a warning message should be displayed indicating "values have exceeded a sum 100".

b. Additional requirements include:
i) Be sure to comment your code.
ii) Include a comprehensive set of application test data that you used to test your program. Your test data can be shown in a table that includes input data, expected output, actual output and pass/fail results from the test.

Problem 2:

a. Design and implement a Java program that computes a speeding fine according to the speed limit, the actual speed, the speeding zone and the processing fee. The program should output the fine based on the user's input.

There are 3 different zones: highway, residential, and school:
- for highway, the fine is 5 times the amount of speed excess plus processing fee
- for residential, the fine is 7 times the amount of speed excess plus processing fee
- for school, the fine is 9 times the amount of speed excess plus 100 plus processing fee

b. Additional requirements include:
i) Use JOptionPane.showInputDialog() methods for your user to input their data
ii) Use JOptionPane.showMessageDialog() methods to display your result.
iii) Include a comprehensive set of application test data that you used to test your program. Your test data can be shown in a table that includes input data, expected output, actual output and pass/fail results from the test. Your test data can be presented in the form of a table as follows: (see attachment).

See attachments for example application test data.

Purchase this Solution

Solution Summary

Provides steps necessary to create both C# and Java applications.

Solution Preview

Dear Student,
Attached are the source code and test documents.

Java:

1) SpeedLimit.java (java source code).
You can compile it ...

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C# variables and classes

This quiz contains questions about C# classes and variables.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.