Concept explainers
Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 10 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Additional Engineering Textbook Solutions
Starting Out With Visual Basic (8th Edition)
Modern Database Management (12th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Problem Solving with C++ (10th Edition)
Concepts of Programming Languages (11th Edition)
Starting Out with Java: Early Objects (6th Edition)
- Write a program that meets the followingrequirements:■■ Get an audio file from the class directory using AudioClip.■■ Place three buttons labeled Play, Loop, and Stop, as shown in Figure .■■ If you click the Play button, the audio file is played once. If you click the Loopbutton, the audio file keeps playing repeatedly. If you click the Stop button,the playing stops.arrow_forwardWrite a program that reads in from a file a starting month name, anending month name, and then the monthly rainfall for each monthduring that period. As it does this, it should sum the rainfall amountsand then report the total rainfall and average rainfall for the period.For example, the output might look like this:During the months of March–June, the total rainfall was 7.32 inchesand the average monthly rainfall was 1.83 inches.arrow_forwardWrite a program that prompts the user for an input file name, reads all words from the input file, and writes the words to the output file named sentences.txt. Start a new line whenever a word ends in a period, question mark, or exclamation mark.arrow_forward
- Write a java program in a single file that: Main: Creates 10 random doubles, all between 1 and 11, Calls a method that writes 10 random doubles to a text file, one number per line. Calls a method that reads the text file and displays all the doubles and their sum accurate to two decimal places.arrow_forwardWrite a Java program to read an external file like feedback.txt, parse the victim(ex. bartlebey/bartlebey's experts) and the compliment (ex. geniuses/great), and print them in the console as well as in an output file(create an output file for this in java). The attached feedback.txt has information of feedbacks given. feedback.txt : Bartlebey is Great ; Bartlebey's experts are geniusesarrow_forwardWrite a program that reads data from a file containing integers that ends with -999. Output the numbers that are divisible by 7 Output the numbers that are divisible by 11 Output the numbers that are not divisible by 7 or 11arrow_forward
- Write a method called flipLines that accepts a Scanner for an input file and writes to the console the same file's contents with each pair of lines reversed in order. If the file contains an odd number of lines, leave the last line unmodified. For example, if the file contains: Twas brillig and the slithy toves did gyre and gimble in the wabe. All mimsey were the borogroves, and the mome raths outgrabe. your method should produce the following output: did gyre and gimble in the wabe. Twas brillig and the slithy toves and the mome raths outgrabe. All mimsey were the borogroves,arrow_forwardWrite a program that reads a text file named as “input.txt” and performs the following operations:1. Write each word in the text file in reverse order to the file named as“output.txt” . (Example: If the text file contains ”Hello World!”, then itshould write to the output file ”olleH dlroW!”)2. Print the number of words.3. Print the number of words starting with a capital letter.4. Print the number of words that contain no characters other than Englishletters.In this challenge you are supposed to:1. Comment every function with a description explaining what it does andhow it does it.2. Research and learn how to read and write into text files by using properlibrary functions in C.In your program, you can assume that1. Both the input file (input.txt) and the output file (output.txt) will beplaced on the same folder as your program’s executable (.exe).2. In the input file, the length of the words will be at most 100.arrow_forwardCreate a program to input names of two persons (preferably of different genders) and output their resulting relationship based on the FLAMES method: F – Friends L – Lovers A – Adversaries M – Married E – Enemies S – Sweethearts The FLAMES Method: Compare the two input names and count the letters in the first input name that matches in the second name and vice versa. Determine the corresponding letter of the resulting number in the word FLAMES. Add the resulting number from both names and follow step 2. Filename: flames.carrow_forward
- write a program in java. it is basically a restuarant in which a person had to create an account. if he already has a account he can directly book a reservation. make sure that Reservation is properly done by Java Calender. Later the Restuarant will ask for the review of the dish also give a coupon of 10%,15% discount to fully satisfied the customer. and all of this will be save in a text file and next time if we run the code the reservation slots should be booked. make sure you put try catch phrases. classes are Customer and Restuarantt if these helps. All classes should be in the same file with Main Class also provide the screenshots of the code running in compiler. This is a basic Java project that is only gonna execute on CLI. and the screenshot are the code running on VS code or any other compiler. don't copy any other code because they are wrongarrow_forwardExplain in your own words when writing data to a file, what is the difference between the print and the println methods? Explain in your own words what does the Scanner class’s hasNext method return when the end of the file has been reached?arrow_forwardWrite a program that will sequentially list numbers from 0 to 50, changing its color depending on the size of the number, for example, for numbers from 0 to 10 it will be green, 11 to 22 red and 23 to 35 blue, etc. Limit the screen output speed to about 1 character / second. In order to change colors, you must first use the GetStdHandle function to get a handle to the console, which is similar to getting a file pointer before working with a file. It is done e.g. as follows: HANDLE hConsole; hConsole = GetStdHandle (STD_OUTPUT_HANDLE); The above functions are defined in windows.h Tip 2: Write a utility to find out the colors corresponding to all combinations from 0 to 255. Tip 3: Instructions and sample program for working with time. C language plz with explanation of codes. thanksarrow_forward
- 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