Absolute Java (6th Edition)
6th Edition
ISBN: 9780134041674
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 3, Problem 13PP
The file words. txt on the hook's website contains 87,314 words from the English language. Write a
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
In python
The text file “studentMarks.txt” has been provided for you.
Each line contains the Last Name, First Name and 8 marks separated by spaces of a single student.
For each student in the file, adjust the file to include the average of their top 6 marks, rounded to 1 decimal place, at the end of the line.
For example, in the file, the line may say:
Mars, Bruno 82 82 85 94 65 79 81 90
Afterwards, it should be updated to say:
Mars, Bruno 82 82 85 94 65 79 81 90 Top6Avg: 85.7
Your program must define a function to determine the average of the top 6 marks. You may define more functions as needed for your program.
Python
The filescores.txt contains a list of names and test scores. Create a program named that reads each line of the file and determines the highest score and who obtained it. Since the lab is an exercise in strings, you must use at least one string method to determine the names and the scores.
Using Javascript and HTML:
An interesting application of computers is drawing graphs and bar charts (sometimes called histograms). Write a script that reads five numbers between 1 and 30. For each number read, output HTML5 text that displays a line containing the same number of adjacent asterisks. For example, if your program reads the number 5, it should out HTML5 test that displays *****.
Chapter 3 Solutions
Absolute Java (6th Edition)
Ch. 3 - Write an if-else statement that outputs the word...Ch. 3 - Suppose savings and expenses are variables of type...Ch. 3 - Suppose number is a variable of type int. Write an...Ch. 3 - Suppose salary and deductions are variables of...Ch. 3 - What output will be produced by the following...Ch. 3 - What would be the output in Self-Test Exercise 5...Ch. 3 - What would be the output in Self-Test Exercise 5...Ch. 3 - Write a multiway if-else statement that classifies...Ch. 3 - Prob. 9STECh. 3 - Prob. 10STE
Ch. 3 - Prob. 11STECh. 3 - Prob. 12STECh. 3 - Prob. 13STECh. 3 - Suppose are two variables that have been given...Ch. 3 - Prob. 15STECh. 3 - Assume that nextword is a String variable that has...Ch. 3 - Write an if-else statement that outputs the word...Ch. 3 - Write an if-else statement that outputs the word...Ch. 3 - Determine the value, true or false, of each of the...Ch. 3 - Does the following sequence produce a division by...Ch. 3 - Prob. 21STECh. 3 - Prob. 22STECh. 3 - What output would be produced in Self-Test...Ch. 3 - What is the output produced by the following?
Ch. 3 - What output would be produced in Self-Test...Ch. 3 - Prob. 26STECh. 3 - What is the most important difference between a...Ch. 3 - Prob. 28STECh. 3 - Prob. 29STECh. 3 - What is the output of the following?
Ch. 3 - Rewrite the following for statement as a while...Ch. 3 - What is the output of the following loop? Identify...Ch. 3 - What is the output of the following loop? Comment...Ch. 3 - Prob. 34STECh. 3 - For each of the following situations, tell which...Ch. 3 - What is the output of the following?
Ch. 3 - What is the output of the following?
Ch. 3 - What is the output produced by the following?...Ch. 3 - What is the output produced by the following?...Ch. 3 - Fix the bug in the code in the earlier subsection...Ch. 3 - Add some suitable output statements to the...Ch. 3 - What is the bug in the following code? What do you...Ch. 3 - Prob. 43STECh. 3 - What numbers could be generated by...Ch. 3 - What numbers could be generated by...Ch. 3 - Use the method Math. random to generate a random...Ch. 3 - (This is a version of Programming Project 2.1 from...Ch. 3 - A designer is trying to create a new pattern of...Ch. 3 - Weight is defined as the gravitational force...Ch. 3 - It is difficult to make a budget that spans...Ch. 3 - You have just purchased a stereo system that cost ...Ch. 3 - The Fibonacci numbers Fn are defined as follows:...Ch. 3 - An Armstrong number is an n-digit number that...Ch. 3 - In a certain code language, numerals are each...Ch. 3 - Write a program that calculates the total grade...Ch. 3 - The game of Pig is a simple two-player dice game...Ch. 3 - You have three identical prizes to give away and a...Ch. 3 - Redo or do for the first time Programming Project...Ch. 3 - The file words. txt on the hook's website contains...Ch. 3 - The file words. txt on the book's website contains...Ch. 3 - This problem is based on a "Nifty Assignment" by...Ch. 3 - Prob. 16PP
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Give an example of a data constraint.
Database Concepts (8th Edition)
What method do you call to open a text file to read data from it?
Starting out with Visual C# (4th Edition)
Add a constructor to the class Student that sets the students name to a given argument string and sets the stud...
Java: An Introduction to Problem Solving and Programming (8th Edition)
Redefine the implementation of the class Month described in Programming Project 3 (or do the definition for the...
Problem Solving with C++ (10th Edition)
Convert the Whi1e loop in the following code to a Do-Whi1e loop: Declare Integer x = 1 While x 0 Display "Ente...
Starting Out with Programming Logic and Design (4th Edition)
Explain the problems that denormalized tables may have for insert, update, and delete actions.
Database Concepts (7th Edition)
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
- IN JAVA ONLY PLEASE. POSITIVE REVIEW WILL BE LEFT FOR CORRECT LANGUAGE ONLY AND NOT COPY PASTE FROM INCORRECT ANSWER A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Ex: If the input of the program is: ParkPhotos.txt and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg AmericanSamoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns2010_photo.jpg CraterLake1996_photo.jpg…arrow_forwardCreate a JavaScript file that will display the following using any type of Loop (for, while or do...while): 1. Print all numbers between -10 and 19.2. Print all even numbers between 10 and 40.3. Print all odd numbers between 300 and 333.4. Print all numbers divisible by 5 and 3 between 5 and 50.arrow_forwardWrite a program that reads a sentence and store it in an array of characters. The program also reads a word and store in it a string variable. The program then conceals the word in the sentence with the character @'. Sample input / output: Enter a sentence: The town in which we live is a green town and big Enter a word: town Result: The @aa@ in which we live is a green @@@@ _and bigarrow_forward
- Lab Task 04: Include the methods in the file KMP_Implementation.txt in a complete Java program that prompts for and reads a text string and then a text pattern to search for in the text. It then displays the result of the search. Sample program runs: Enter the text: ABABСАВАВАВСАВАВСАВАВСАВАВКККАВАВСАВАВ Enter the pattern to search for: ABABCABAB Pattern found at these text starting indexes: 0 Enter the text: A KFUPM STUDENT Enter the pattern to search for: KFE Pattern not in text. 7 12 17 29arrow_forwardIN PYTHON, num.txt is a file that contains a list of scores. num.txt 10 25 36 45 89 42 54 create a program that reads the scores from num.txt file one line at a time. The program should display their total and average. since the number of scores is unknown, the program must keep looping until readline is blank. Sample Output: There are 7 scores The total is 301 The average is 43.0arrow_forward2. Write a program called ListOddNumbers that prints the below (there is a single space between each number). Printing odd numbers between 1 and 501 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 3. Write a program called NestedLoop that prints the below. Use a for nested loop. You need to use if nested loop. 122333444455555arrow_forward
- Write a program to calculate students’ average test scores and their grades.You may assume the following input data is read from a text file.Johnson 85 83 77 91 76Aniston 80 90 95 93 48Cooper 78 81 11 90 73Gupta 92 83 30 69 87Blair 23 45 96 38 59Clark 60 85 45 39 67Kennedy 77 31 52 74 83Bronson 93 94 89 77 97Sunny 79 85 28 93 82Smith 85 72 49 75 63Use three arrays: a one-dimensional array to store the students’ names, a (parallel) two-dimensional array to store the test scores, and a parallel one-dimensional array to store grades. Your program must contain at least the following functions: a function called GetData to read and store data into two arrays, a function called Average that is used to calculate the average test score and grade, and a function called PrintResults to output the results. The student names should be to the left with a width of 10 columns. The test scores should be to the right with a width of 8 columns. Have your program also output the class average on a line…arrow_forwardComputer Science Python! Compose a program that reads in a csv file filters and splits the data. For example given example.csv PYTHON please! lebron james 55 michael jordan 35 allen iverson 89 ouput creates 2 new files one with lebron michael allen and the second one with leaving the numbers out due to the filter james jordan iversonarrow_forwardMany applications possess a word search facility that will parse a text file to identify the presence of a given word. You are required to write a Java application using Netbeans that will open a text file of prose and search for a target word input by the user. The Search functionality would be done int two ways: 1. Search for the number of occurrences of the word. For example, if the user types ‘the’, the program should print out the number of times the word the appears in the text.2. A wildcard search.A wildcard could be used to represent one or more multiple characters at the beginning or end of a word, and/or as a direct replacement for a single character. For example, if the text contained the words ‘shape’, ‘tape’ and ‘hate’, then queried string ‘*ape’ would return ‘shape’ and ‘tape’, whilst ‘s*ape’ could only return ‘shape’. Perhaps leading, trailing and single letter substitution wildcards can be made allowable within the same single word search. A text file is…arrow_forward
- The python function first_words takes one parameter, fname, the name of a text file, and returns a list containing the first word from each line of the file. For example, if the file contents are: apples are red bananas are yellow limes are green then the list ["apples", "bananas", "limes"] should be returned.NOTE: You may assume the file will contain no blank lines.BIG HINT: If line is a string representing a line of text (inside of a for loop!), then L = line.split() creates a list of the words in the line.arrow_forwardUsing matplotlib, a Python program that reads the contents of the file see attached then plots the data as either a line graph or a bar chart. Be sure to display meaningful labels along the X and Y axes, as well as the tick marks. The file contains the average gas price for each week in the year 1994. (There are 52 lines in the file.) I copyed and pasted the contents of the file 0.9920.9951.0010.9991.0051.0071.0161.0091.0041.0071.0051.0071.0121.0111.0281.0331.0371.041.0451.0461.051.0561.0651.0731.0791.0951.0971.1031.1091.1141.131.1571.1611.1651.1611.1561.151.141.1291.121.1141.1061.1071.1211.1231.1221.1131.1171.1271.1311.1341.125arrow_forwardThe file “dna.seq” (on Blackboard) consists of several DNA sequences. Write a program that reads in the file “dna.seq” and counts the number of sequences with the following properties:• The total number of sequences in the file• The number of sequences that have the pattern CTATA• The number of sequences that have more than 1000 bases• The number of sequences that have over 50% GC composition• The number of sequences that have more than 2000 bases and more than 50% GCcompositionUse pythonarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY