Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

Raina Yukoma

+ Follow
since Oct 22, 2013
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Raina Yukoma

Yes, but I also want the input data in the textfile be incorporated within similar output format in the sample I provided
8 years ago
Hello, I am trying to modify the source code to read the sales amounts from a text file instead of the keyboard The code itself works and does that but it reads the text file and then asks me to input data. I am kind of a novice/intermediate so any advice would be greatly appreciated.
The purpose of this program:

Write a program that stores the weekly (Monday thru Friday) sales totals for three salespersons. Your program should read the sales amounts from a text file and print a sales report with headings, the daily totals for each salesperson (your two-dimensional array), the calculated weekly totals for each sales person and the calculated totals for the day of each salesperson. In addition, create a single-dimensional array of Strings representing the days of the week (Monday-Friday) using an initializer list.

Output Screen

Weekly Sales Report

Mon Tue Wed Thurs Fri Total

1 10.00 20.00 30.00 40.00 50.00 150.00
2 60.00 70.00 80.00 90.00 10.00 310.00
3 20.00 30.00 40.00 50.00 60.00 200.00
90.00 120.00 150.00 180.00 120.00 660.00

8 years ago
I think I got it, thanks guys. I got it to work I just need to test for it.

8 years ago
Going to start working on most of it tonight, I took your advice and set it up something like this:

8 years ago

Stuart A. Burkett wrote:The specification makes no mention of billing so you need to get rid of everything related to that.
Start off with an empty class definition. Something like

and then go through the specification step by step to add the required features. Test everything before you go on to the next step.

Thank you for the reply - that was just a sample code, here is what I started with:

The public private x2 part I am unsure what I should do for that in order to encapsulate the concept of a telephone number

8 years ago
Hello, I am stuck on a particular assignment on where we:

Write a class encapsulating the concept of a telephone number, assuming a telephone number has only a single attribute: a String representing the telephone number in 10 digits (e.g. 5168761234) with no punctuation. Include a default constructor, an overloaded constructor, the accessor and mutator methods, and the methods equals() and toString(). Your toString() method should return the telephone number with punctuation (e.g. (516) 876-4257 ). Also include a method that returns the area code (first three digits). If there are less than three digits then your area code method should return “unknown area code”. In addition, write a client class to test all the methods in your class.

I am confuse how on what I should use as my variables other than the phone.
I know my private String should be the phonnumber but what should do my double or final int?
I was going to use this as starting code for this assignment:



8 years ago