Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 30.2, Problem 30.2.1CP
Program Plan Intro
Purpose of given code:
Purpose of given code is to implements the aggregate operations using “Stream” class.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write a Program in C Language.
Write a program that reads words from a filename, which is given as a string argument. It should return the words from the file in a list, sorted in reverse alphabetical order (case insensitive) .
For instance, if the file has
bell tea Zebra apple yellow
Then the output should be
['Zebra', 'yellow', 'tea', 'bell', 'apple']
def reverse_sorted_words(filename):
# YOUR CODE HERE raise NotImplementedError()
model small
.stack
.data
string db "ODD EVEN$"
string2 db "Input:$"
.code
org 100h
start:
main proc
mov ax,03
int 10h
mov ax,@data
mov ds,ax
mov ah,9
lea dx,string
int 21h
call nlcr
mov ah,9
lea dx,string2
int 21h
mov ah,1
int 21h
mov dl,al
mov ah,2
add dl,20h
int 21h
mov cx,25
y:
mov ah,2
dec dl
int 21h
loop y
mov ah,4ch
int 21h
main endp
nlcr proc
mov ah,2
mov dl,13
int 21h
mov dl,10
int 21h
ret
nlcr endp
end start
What is the Output screenshots
Chapter 30 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Ch. 30.1 - Prob. 30.1.1CPCh. 30.2 - Prob. 30.2.1CPCh. 30.2 - Prob. 30.2.2CPCh. 30.2 - Prob. 30.2.3CPCh. 30.2 - Prob. 30.2.4CPCh. 30.3 - Prob. 30.3.1CPCh. 30.3 - Prob. 30.3.2CPCh. 30.3 - Prob. 30.3.3CPCh. 30.3 - Prob. 30.3.4CPCh. 30.3 - Given an array names in Listing 30.1, write the...
Ch. 30.4 - Prob. 30.4.1CPCh. 30.4 - How do you create a parallel stream?Ch. 30.4 - Prob. 30.4.3CPCh. 30.4 - Prob. 30.4.4CPCh. 30.4 - Prob. 30.4.5CPCh. 30.4 - Write a statement to obtain an array of 1000...Ch. 30.5 - Prob. 30.5.1CPCh. 30.5 - Prob. 30.5.2CPCh. 30.5 - Prob. 30.5.3CPCh. 30.5 - Prob. 30.5.4CPCh. 30.6 - Prob. 30.6.1CPCh. 30.7 - Prob. 30.7.1CPCh. 30.8 - Can the following code be used to replace line 19...Ch. 30.8 - Prob. 30.8.2CPCh. 30.8 - Prob. 30.8.3CPCh. 30.8 - Prob. 30.8.4CPCh. 30.8 - Write the code to obtain a one-dimensional array...Ch. 30 - Prob. 30.1PECh. 30 - Prob. 30.2PECh. 30 - Prob. 30.3PECh. 30 - (Print distinct numbers) Rewrite Programming...Ch. 30 - Prob. 30.5PECh. 30 - Prob. 30.6PECh. 30 - Prob. 30.7PECh. 30 - Prob. 30.8PECh. 30 - Prob. 30.9PECh. 30 - Prob. 30.10PECh. 30 - Prob. 30.11PECh. 30 - (Sum the digits in an integer) Rewrite Programming...Ch. 30 - (Count the letters in a string) Rewrite...Ch. 30 - Prob. 30.14PECh. 30 - (Display words in ascending alphabetical order)...Ch. 30 - Prob. 30.16PECh. 30 - Prob. 30.17PECh. 30 - (Count the occurrences of words in a text file)...Ch. 30 - (Summary information) Suppose the file test.txt...
Knowledge Booster
Similar questions
- Here is the iterative implementation of binary search: For each call to binary_search below, indicate how many times the code inside the while loop will execute. animals = ["aardvark", "cat", "dog", "elephant", "panda"] 1. binary_search("elephant", animals) 2. binary_search("dog", animals) 3. binary_search("anteater", animals)arrow_forwardvoid doo(list &L){ int item,a,p=L.size()-1; L.retrieve(p,a); for(int i=0;iarrow_forwardvoid ExtractMinimumWeightPath(int path[MAX], int weights[MAX][MAX], int pathWeights[MAX][MAX], int rowc, int colc){int rowsCount = rowc;int colsCount = colc;path[rowsCount];int col = 0;int i = 0;for(i=1;i<colsCount;i++){if(pathWeights[rowsCount-1][i]<pathWeights[rowsCount-1][col]){col = i;}} int row = rowsCount-1;do{path[row] = col + 1;if (col>0 && pathWeights[row-1][col-1] + weights[row][col] == pathWeights[row][col]){col = col - 1;} else if (col < colsCount-1 && pathWeights[row-1][col+1] + weights[row][col] == pathWeights[row][col]){col = col + 1;}row--;} while(row>0);path[0] = col + 1;} This is a code in C, I need to change the code as much as possible, but on condition to perform the same work as this. Changing the var names and the loops is enougharrow_forwardThe dataset file in assets/grades.txt contains a line separated list of people with their grade in a class. Create a regex to generate a list of just those students who received a B in the course. In [2] import re def grades(): with open ("assets/grades.txt", "r") as file: grades = file.read() count = re.findall("(.*):B",grades) return count print (grades()) raise Not ImplementedError() In [3]: assert len (grades()) == 16 Traceback (most recent call last) AssertionError ----> 1 assert len (grades()) AssertionError: in == 16arrow_forwardHello, please answer this java question quick. implement the top code so it could satisfy the test code, thanks.package question3; import java.util.List; import java.util.stream.Collectors; import org.testng.Assert; import org.testng.annotations.Test; public class Question3 { /* Add stream methods to filter out users with less than 3 items, and return their names */ @Test public void test(){ var user1 = new User("a", 1); Assert.assertEquals(StreamsTest.processStream( List.of(user1).stream()).collect(Collectors.joining("")), ""); var user2 = new User("b", 5); Assert.assertEquals(StreamsTest.processStream( List.of(user1, user2).stream()).collect(Collectors.joining("")), "b"); var user3 = new User("c", 7); Assert.assertEquals(StreamsTest.processStream( List.of(user1, user2, user3).stream()).collect(Collectors.joining("")), "bc"); } }arrow_forward1. Write a get hash() function, which returns the index in the hash table. The hash function is calculated as follows: h(key) is calculated as the remainder after (key +7) is divided by the size of hash table The function header is as follows which has two parameters: key and size of hash table def get hash(key, size):arrow_forwardyou will create a spell checker. The program will take three command line arguments: number of words in the dictionary, a dictionary file name, and a text file name. The program will first create a hash table. The number buckets of the hash table should be about twice the number of words in the dictionary. Then, it will read the dictionary from the file, insert the words into the hash table, and report collision statistics. After reading the dictionary, the spelling checker will read a list of words from a text file. Each word will be looked up in the dictionary. If it is incorrect, it will be written to the standard output together with a list of suggested corrections. The algorithm for generating corrections is given below. Hash Table The hash table programs, QuadraticProbing.h and QuadraticProbing.cpp, are posted on Canvas. The programs use quadratic probing to deal with collisions. You should carefully study these programs and make some changes to collect the required statistics.…arrow_forwardMultiple key-value pairs, each representing a hotel room number and the guest's name, are read from input and added to room_data. Assign sorted_values with a sorted list of the values in room_data.arrow_forwardplease need code in java for all the parts below thanks. explanation if possiblearrow_forwardwhat is the problem in this code ? def add():id = input("Enter ID:")f = open("data.txt", "r")id_list = []lines = f.readlines()if lines != "":for line in lines:token = line.split(" ")id_list.append(token[0])for i in id_list:if i == id:print("The student record is already in the database!Zero records added")returnf.close()file = open("data.txt", "a")name = input("Enter name: ")course = input("Enter course: ")absences = int(input("Enter absences: "))exam1 = int(input("Enter exam 1 grade: "))exam2 = int(input("Enter exam 2 grade: "))marks = int(input("Enter Total Marks: "))s = id+" "+name+" "+course+" "+str(absences)+" "+str(exam1)+" "+str(exam2)+" "+str(marks)+"\n"file.write(s)file.close()while True:print("1.Add a student")print("Any other numeric to terminate")choice = int(input())if choice == 1:add()else:breakarrow_forwardIn Python languagearrow_forwardpublic static void main(String[] args) throws IOException{ BufferedReader b=new BufferedReader(new InputStreamReader(System.in)); System.out.print("Input instructor Salary: "); double salary=Double.parseDouble(b.readLine()); System.out.print("Input Academic Rank: "); String rank=b.readLine(); double tax=0; if(rank.equalsIgnoreCase("Assistant")) tax=salary*9/100; else if(rank.equalsIgnoreCase("Associate")) tax=salary*12/100; else if(rank.equalsIgnoreCase("Lecturer")) tax=salary*7/100; double net_salary=salary-tax; System.out.println("\nThe amount of Tax is BD "+tax); System.out.println("The Net Salary is BD "+net_salary); } }arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_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