subject

Summary In this assignment, you will build a program using techniques from previous CSS courses that counts unique fractions. No new constructs from our readings are expected, and as such, you can complete this program with just a handful of lines (10–20) of code in just one main function. You will need to use loops, ifs, comments, etc., (in other words, structured programming) to complete this assignment and achieve the outcomes listed below. Included below is a sample execution of your program as well as a list of outcomes your program is to implement; you do not have to report the fractions in reduced form, though you may choose to do so (you do, however, have to count all equivalent fractions, e. g., 12/6 and 6/3 are equivalent to each other and each contribute to the number of occurrences of the reduced unique fraction 2/1).
Introduction
Your project is to read in a series of fractions from a text file, which will have each line formatted as follows: "A/B". A sample text file is listed below, and the purpose of your program is to read in each fraction and count the number of occurrences for the current fraction. When all the input is consumed (or as the input is consumed), your program will print out its list of unique fraction and their corresponding count — see the output below (and you may assume no blank lines or misleading characters. See the text file link for one of the actual inputs I’ll use when testing your submission; I may use other, similarly formatted input files. The code shoukd work for any number of lines (should work for 100,000 lines too)
Sample Text Input
6/3
7/3
6/3
12/6
Sample Console Output
6/3 has a count of 3
7/3 has a count of 1
Try to keep in mind basic "structured programming" principles such as modular design (ie, decompose complex tasks into individual methods), good variable & methods names (self-documenting code), and comments.
NB: By "unique fraction" I do not mean "unique string value" but "unique rational number value."
Consider reading one line at a time (with scanner. nextLine()), and using the split (Links to an external site.) function (defined in class String) to give you an array with two elements in it (the numerator and denominator, respectively).
Your program should work with input files besides the sample given, even long files (e. g., 100,000 lines long).

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
If i wanted to include a built-in calendar in a document, what option could i select? draw table insert table insert chart quick tables
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
You can apply several different worksheet themes from which tab?
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
Read “suburban homes construction project” at the end of chapters 8 and 9 (in the textbook) and then develop a wbs (work breakdown structure) in microsoft excel or in microsoft word (using tables)
Answers: 1
You know the right answer?
Summary In this assignment, you will build a program using techniques from previous CSS courses tha...
Questions
question
Biology, 12.11.2020 07:20
question
Mathematics, 12.11.2020 07:20
question
Mathematics, 12.11.2020 07:20
Questions on the website: 13722361