
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question

Transcribed Image Text:Problem 3:
Download the needed files and look for the data.txt file. This file should have
multiple lines, each line has first name, last name followed by multiple integers.
Create a class named MaximumOfEachLine with a main method..
Read the data from the "data.txt" file.
Find the maximum integer in each line.
Display the first name and the last name followed by the maximum integer
found in that line.
Make sure to have the proper import statements.
Your code must handle FileNotFoundException.
If the file is missing, your program should display "File Not Found".
If you did all the above correctly, this is the output you should get:
Samantha Johns
Max: 99
Max: 100
Max: 92
Michael Smith
John Michael
Mary Hernandez
George Johnson
Sara Anderson
Susan John
Mark Smith
Max: 92
Max: 93
Max: 83
Max: 84
Max: 69
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 3 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Create a file named Question.py and then create a class on it named Question. A Question object will contain information about a trivia question. It should have the following: A constructor, with the following parameters: 1 string to be the question itself (for example: "When was Cypress College Founded?"). A list of four strings, each a possible answer to the question (only one of them should be correct) An integer named 'answer': the index in the list of the correct answer. Example: if the third answer in the answer list is the correct one, the client should pass 2 to this parameter to signify the correct answer is in index 2. Overload the __str__ method. It should return a string made up of the question and the four possible answers. A ‘guess’ method, with an integer parameter. If the 'answer' attribute matches the int passed to 'guess', return True. Otherwise, False On Main.py, in your main function, create a list and add four Question objects to it. You may give them with…arrow_forwardThis is for Advanced Java Programming Write a test program that reads words from a text file and displays all non-duplicate words in ascending order and then in descending order. - The file is to be referenced in the program, not needing to be used as a command line reference. - The word file is to be titled collection_of_words.txt and included in your submission. Write test code that ensures the code functions correctly.arrow_forward1. Complete the class code below and include a method named "search" that takes two String parameters, a string to search and the other a target string to search for in the first string. The search method will return an integer representing the number of times the search string was found. The string being searched is a super-string formed by joining all lines of a text file, so we might expect to get multiple hits with our method. HINT: walk the String in a loop and use .substring(start, end) to examine a target-sized segment of the input string for equality to your target word. public class WordSearch { public static void main(String[] args) { String fileName String target = "help"; Scanner fileln = new Scanner(new File(fileName)); "story.txt"; %D String story = while(fileln.hasNextLine()) { story += fileln.nextLine(); // Build a super-String } System.out.printIn("(" + target + ") found "+ search(story, target) + " times"); } /l method code here } // end of WordSearch classarrow_forward
- Output should be 5. Please help me find my error, and create 5 tests below in a seperate file using the corrected code. Thanks. 1. create a strawberryStand object2. create one or more MenuItem objects and add them to the strawberryStand's menu3. create a dictionary of sales for the day that includes sales of at least one item that isn't in the menu4. try calling enter_sales_for_today(), passing that sales dictionary as the argument5. If an InvalidSalesItem is raised, it should be caught with a try/except that prints an explanatory message for the user (otherwise the function should proceed normally). class MenuItem: def __init__(self, name, wholesale_cost, selling_price): self.name = name self.wholesale_cost = wholesale_cost self.selling_price = selling_price def get_name(self): return self.name def get_wholesale_cost(self): return self.wholesale_cost def get_selling_price(self): return self.selling_price class SalesForDay:…arrow_forwardCreate a new Python file in your project named FullName.py. In this module, create a class named FullName. When creating a FullName object, the client will pass a string for first name and a string for last name, which the constructor will assign to two attributes. Your class should have the following methods: __init__, __str__, and __gt__. __gt__ will compare two FullName objects using the following logic: If person A’s last name comes after person B’s last name alphabetically, person A is “greater than” person B. If their last names are equal, check their first names to see which is greater. Hint: The > and < operators are already overloaded for string objects, so your __gt__ method should be relatively simple. In your main.py file, demonstrate creating a few FullName objects and calling these methods on them.arrow_forwardCreate a file named Store.Java. In that file, create a method with the following signature: public static double calculateRetail(double wholesale, double markup) This method should calculate how much a product should sell for based on the wholesale price and markup percentage. Make a Java code that results like test case examples.arrow_forward
- need main method that connects to a second method with user input and prints like the example below. the second method contains the followng, and both methods connect to an input txt file that has 45 games in the following format. number of games(blank line)game 1 namegame 1 platforms (separated by commas)game 1 year(blank line)etc. with game 2, game 3, and for number of games total gamesarrow_forwardUse an IDE for this assignment and create a package called ER – put the three files in the package. In this assignment, you will create an application that will simulate the patients in an emergency room and how long they wait before they are seen. Every patient is assigned a priority from 1 to 10 (1 is the most important and 10 is the least important). The patients will be read in from the file PatientData.txt which has each record (line) as icetlame, lastNamE, patientlR, year, month, day, priority Create classes as follows Patient with 4 attributes - firstName, lastName, patientID (7 digits, cannot begin with 0), DOB. Add constructors and other methods. ERCase with 3 attributes – Patient, priority, timeWaitiog, Add constructors and other methods. This class must implement the interface Comparable and implement the method public int compareTe(ERCase c) EmergencyRoom- uses a Priority Queue to manage the patients in the ER waiting room. Add 5 cases to the Priority Queue at the start of…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education