subject

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, 21.06.2019 19:30
Which of the following are types of formatting you can apply to a spreadsheet? choose all that apply.
Answers: 3
question
Computers and Technology, 22.06.2019 01:50
A.) generate scaffolding to create database for your application. develop all the entities identified in assignment #2. add any additional that may be identified later. b.) add data validation rules to the models that are appropriate for your application and data. c.) create links for each scaffold in the header section. part 2: application updates [30 points] a.) add two additional views to the "home" controller you created in assignment #1. b.) the two views should be named as “privacy" and "". c.) link the two newly created views in the footer section. hint: you would need to modify the “home" controller definition and create “privacy.html.erb" and “.html.erb" files in appropriate locations.
Answers: 3
question
Computers and Technology, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 24.06.2019 13:30
Type the correct answer in the box. spell all words correctly. what is the default margin width on all four sides of a document? by default, the document has a margin on all four sides.
Answers: 1
You know the right answer?
In this assignment, you will build a program using techniques from previous CSS courses that counts...
Questions
question
Mathematics, 16.10.2020 20:01
question
Mathematics, 16.10.2020 20:01
question
English, 16.10.2020 20:01
question
Mathematics, 16.10.2020 20:01
Questions on the website: 13722360