Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ASSIGNMENT 3 Assignment 3 tests your knowledge of functions (Chapter 6), strings (Chapter 7) and arrays (Chapter 8) in C++. Write a program that uses

ASSIGNMENT 3 Assignment 3 tests your knowledge of functions (Chapter 6), strings (Chapter 7) and arrays (Chapter 8) in C++. Write a program that uses functions to read and process the data from a formatted file. The program should contain the following exact functions (exact name, parameters names, parameters type, parameter order, returned values, functionality and no global variables or concepts not studied in class) in this exact order: 1. A ReadConcepts function that reads a list of concepts/strings from the LIST.txt text file (one concept per line), stores them into an array of 100 strings called ArrayConcepts, and count how many concepts are in the list and store in the reference parameter NumberConcepts. The function should have two parameters (the array of concepts and a reference to the number of concepts in the array and should not return a value. 1 2. A PrintAllConcepts function that prints a message The concepts are: and, on separate lines, prints all the concepts from the array, one concept per line. The function should receive the array of concepts and the number of concepts as parameters and should not return any values.2 3. An EnterWord function that prompt the user to enter a string with at least 2 characters, lets the user input a string, validates it (check if it has at least 2 characters its length is at least 2), and if it is not, repeats the input of the string until it is a valid (has at least 2 characters) and returns it. The function should not have any parameters and should return the string. 3 4. A PrintConceptsWord function that a message The concepts containing WORD are: (replace WORD with the value from the Word parameter) and prints all the concepts from the array that contain an occurrence of the exact string Word, one concept per line. The function should receive the array of concepts ArrayConcepts, the number of concepts NumberConcepts , and the word to search for Word as parameters and should not return any values. 4 5. A PrintConceptsWithoutWord function that a message The concepts that do not contain WORD are: (replace WORD with the value from the Word parameter) that prints all the concepts from the array that do not contain the exact string Word, one concept per line. The function should receive the array of concepts ArrayConcepts, the number of concepts NumberConcepts , and the word to search for Word as parameters and should not return any values.5 6. A SortConcepts function that sort the array using the selection sort method (from the textbook and practice exercises), without using any predefined functions or other sorting methods. The function should receive the array of concepts ArrayConcepts, the number of concepts NumberConcepts as parameters and should not return any values.6 7. The main function should do all of the exact following in this order: i. Declare an array of strings called ArrayConcepts and an integral variuable NumberConcepts ii. Call the ReadConcepts function to read the concepts from the file and store them into the array ArrayConcepts and compute the NumberConcepts of concepts, iii. Call the PrintAllConcepts for ArrayConcepts and NumberConcepts iv. Call EnterString for ArrayConcepts and NumberConcepts to enter a Word v. Call PrintConceptsWord for ArrayConcepts and NumberConcepts and Word above vi. Call PrintConceptsWithoutWord for ArrayConcepts, NumberConcepts, and Word vii. Call the SortConcepts to sort the ArrayConcepts and viii. Call PrintAllConcepts again to print the sorted ArrayConcepts. You should write the program in Visual Studio 2019 using only concepts learned in class so far (Chapters 1 to 8, so, without data structures, pointers, and any other concepts not studied in class so far). You need to create and submit the following exact 2 files (names, functionality, and format, not archived): 1. YourName-Assignment3.cpp C++ source code file for the algorithm 2. YourName-Assignment3-Screenshot.docx screenshots document containing screenshots of your entire code in Editor window and entire program output in Output window (if it does not fit on one screen or cannot be easily read, take multiple screenshots of the code window and of the output window) 1 void ReadConcepts (string ArrayConcepts[100], int &NumberConcepts) 2 void PrintAllConcepts (string ArrayConcepts[100], int NumberConcepts) 3 string EnterString() 4 void PrintConceptsWord (string ArrayConcepts[100], int NumberConcepts, string Word) 5 void PrintConceptsWithoutWord (string ArrayConcepts[100], int NumberConcepts, string Word) 6 void SortConcepts (string ArrayConcepts[100], int Number)

lists:

Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District Of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming American Samoa District of Columbia Guam Northern Mariana Islands Puerto Rico United States Virgin Islands

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

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions