Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

language is C++ Please look at the pictures for the instructions. I need help - Print the text entries and their length in a table

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

language is C++ Please look at the pictures for the instructions. I need help

- Print the text entries and their length in a table format with headings; text entries should be left aligned and numerical entries should be right aligned; tip: use setw() - Display stats - the longest word and its length - the shortest word and its length - the count of the text entries stored - the total number of characters in all text entries - Print text entries in ascending order along with their length (use bubble sort) - Quit Requirements/Specifications - One function = one job - Write one function to produce stats; go through the array of structs once only - Reading an Input File - Only go through the file once - do not read the file to count the number of entries, close it, and then read it again; someone can modify the file in the meantime - Output Formatting - output must be well-formatted, and easily understandable to those who have not seen the code - clearly label the output - Well document your code (comments); comments should be short and explain "why" and "what for" - Include test runs/ output as comment /% below all function definitions at the very bottom of the file with main() How to Approach - Plan, Plan, and Plan again!!! - Test, Test, and Test again!!! - Review Best Practices, Guidelines, and Standards (BPGS) - START SMALL and add functionality to your program incrementally, one at a time, and test it before adding any more functionality; for example, 1. Modify getData() function; read a text entry into a temp struct, and determine the length. If valid, convert all characters to all upper or all lower case and copy the temp struct into the array of structs. Write a function that converts text entries to all upper or all lower case; toupper() and tolower() do not accept strings 2. Stats: write one function to determine and print the required stats. Make only one pass through the array of structs. 3. Sort: find bubble sort of integers online and modify it to sort strings; strings can be compared the same way as numbers; for example, strWord1>strWord2, "Ane"> "ane" (returns false because 'A' has ASCII value of 65 and 'a' has ASCll value of 97) 4. Test the program and Submit. - Let's be professional: This and all other programs in this course should comply with the Best Practices, Guidelines, and Standards posted under Resources because BPGS is based on industry and four-year colleges' best practices and standards. - Thoroughly test your program. Your grade partially depends on the quality of your test data. - use function prototypes - function definitions must be below main() - no global variables (including files) except for const - Let's keep it simple for now - vectors and template classes are not allowed - dynamic memory allocation is not allowed - programs that do not comply with the above will not be accepted - Thoroughly test your program. Your grade partially depends on the quality of your test data. - Must comply with the best practices, guidelines, and standards - Well document your code (comments) - const may be declared global; if global, do not have to be passed to function; any function has access to global variables - files - open where you need them and close when you no longer need them, preferably in the same function - no need to open a file in main() if you only use it in a function - use setw() to format output - do not mix setw() and 'It'; it could produce different results on different computers - Remember - Just because your program does not crash, does not mean it works - A program must comply with all specifications/requirements list, not just some of them

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

Advances In Databases And Information Systems Uropean Conference Adbis 2020 Lyon France August 25 27 2020 Proceedings Lncs 12245

Authors: Jerome Darmont ,Boris Novikov ,Robert Wrembel

1st Edition

3030548317, 978-3030548315

More Books

Students also viewed these Databases questions