Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Finish the program with the program started already Homework 1 100 Points One Dimensional Arrays 22B_H_1A.cpp 22B_H_1B.cpp Pr8-3 BinS.cpp 22B_H_1C.cpp - Binary Search: Find and

Finish the program with the program started already

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Homework 1 100 Points One Dimensional Arrays 22B_H_1A.cpp 22B_H_1B.cpp Pr8-3 BinS.cpp 22B_H_1C.cpp - Binary Search: Find and fix errors - Insertion Sort: Find and fix errors - Binary Search: Code Review - Search a Sorted List of Strings Project: Searching a Sorted List of Strings Write a language translation program that permits the entry of a word in English and prints the corresponding word in another language. The input file dictionary.txt contains up to 128 lines. On each line there is word in English followed by its translation in Hawaiian. You may assume that each line contains exactly two words and that the English words in the file are in alphabetical order, as shown below: above luna below lalo bird manu branch lala canoe wa'a Create the input file using data on the next page. Read data from the input file into two parallel arrays. Use arrays of maximum size 128. In case the input file contains data for more than 128 names, print an error message such as "The file contains more than 128 lines!" and terminate the program. Change the Binary Search function to search the parallel arrays, then test it in a loop as it is shown in Program 8-3. Prompt the user to enter a word in English, such as bird then call the Binary Search function to search for bird. If found, display the Hawaiian word for bird: manu, otherwise display an error message. Keep track of the number of successful searches for each student in another array. When done searching, write the arrays to an output file named results.txt, as shown below. 5 below lalo 11 bird manu 1 canoe wa'a The first number on the first line, 5, shows that there were 5 searches for below, the first number on the second line, 11, shows that there were 11 searches for bird, and so on. Notice that the words that were not searched for, such as branch are not saved to the output file. Next Page Grading Program 1A Program 1B Program Pr8-3_Bins Program 1C Self Assessment Report - 15Points - 20 - 10 - 50 - 5 - 50 Grading Program 1C Read data from file into arrays Binary Search Call Binary Search in a loop Frequency array Write arrays to a file - 10Points - 10 - 10 - 10 - 10 Run each program once and save the output at the end of the source file as a comment. Compress the source files, input and output files (if any), and the report, and upload the compressed file: 22B_LastName_FirstName_Hl.zip Self Assessment Report: Write a short report, (see 22B_H_1Report.docx form) briefly explaining your code and containing an assessment of your implementation based on the above grading criteria. Create the input file dictionary.txt using the following data: above luna below lalo Sample Output: bird manu branch lala Welina! canoe wa'a Welcome! club hui This program translates English words to Hawaiian. coconut niu compose haku What is the input file's name? day la disctionary.txt easy ma'alahi father makua kane Please enter a word in English: triggerfish float lana "triggerfish" in Hawaiian is "humuhumunukunukuapua'a" forest ulula'au garden mala Do you want to search again? (y): y garland lei Please enter a word in English: computer gift makana Sorry, we do not have "computer" in our dictionary. hello aloha huge nunui Do you want to search again? (y): y kitchen lumikule Please enter a word in English: bird large nui "bird" in Hawaiian is "manu" listen ho'olohe market makeke Do you want to search again? (y): y moon mahina Please enter a word in English: triggerfish mother makuahine "triggerfish" in Hawaiian is "humuhumunukunukuapua'a" name inoa parent makua Do you want to search again? (y): y pay uku Please enter a word in English: triggerfish porch lanai "triggerfish" in Hawaiian is "humuhumunukunukuapua'a" practice ho'oma'ama'a rice laiki Do you want to search again? (y): n room lumi sand one seaweed manauea Your search history has been saved into an output file named "results.txt" shark mano sky lani star hoku student haumana Sample Output File: thanks mahalo 1 bird manu they lakou 3 triggerfish humuhumunukunukuapua'a think manalo tired maluhiluhi triggerfish humuhumunukunukuapua'a turtle honu twenty iwakalua watch uaki wave nanea wind makani work hana year makahik 22B - PROGRAM 10: Search a Sorted List of Strings BINARY SEARCH Written by: IDE: // Hawaiian words #include ciostream> #include #include #include #include #include #include

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

Students also viewed these Databases questions