Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[Q1] Write a Java program (Lab05_01 Q1 Jastnamo Java) that display the menu shown in the sample run. The program should contain 5 methods: 1.

image text in transcribed
[Q1] Write a Java program (Lab05_01 Q1 Jastnamo Java) that display the menu shown in the sample run. The program should contain 5 methods: 1. displayManu(): the method should display the menu shown in the sample run, and returm The method should keep inputting a choice until a valid value the char value input by the user. (a.b,c.d) is entered. 2. 3. finditmai 1ByDomain() : takes a domain and an input file name as parameters. The method reads the file, finds the email addresses with the given domain. For each found email address, writes the user names to an output file with the name domain.txt, where the domain is the one passed as a parameter. Note: if the domain is cs, the method should find userOne@cs bilkent.edu.tr and should write, userOne to the file "cs.txt. You may assume there is only one @ symbol in the email address and the domain is between the @ symbol and the first dot following the @ symbol. 4. displayUsersByDomain: takes a domain as a parameter and displays all users at the given domain. Note: if there are no users with the given domain, the file will not exist. To prevent a FileNotFound exception, before reading the file. you should confirm that it exists. To do this, create a file object (File myFile new File("nameOfFile") and use the boolean exists) method to confirm that the file exists. (myFile.exists) returns true if myFile exists otherwise returns false) 5. displayUsersHavingNumeric): takes a domain as a parameter, and reads the file containing users from the given domain, and displays all users in the file with a numeric character in their user name. Before reading the file you should again confirm that the file exists 6. main : using the above methods, display the menu, input data and call the methods as necessary Sample Run: Menut (a) Find email by donain (b) Display users by donain (c) Display numeric userianes by dorain (d) EXIT Enter choice:C Enter domain to search: cs File Not Found Menu: (a) Pind enaii by dosain

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

Azure Analytics is a suite made up of which three tools?

Answered: 1 week ago