Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Plz help with part 1 Programming Assignment Instructions: In this assignment you wil1 create your code from scratch. You are to create a C/C++ file

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedPlz help with part 1

Programming Assignment Instructions: In this assignment you wil1 create your code from scratch. You are to create a C/C++ file named _hw3.c or .cpp NOTE-You may use C++-but you MAY NOT use #include The goal is to use C-Style character array based strings. You wi11 put all of your code in this file. You may use any technique we have learned so far. Specifications: This assignment is split into several parts. The goal is to get you used to working with C/C++ run-time arrays and strings. Part 0- Create a Menu You should create a menu that gives access to each of the parts of the assignment. Show this menu and make it function properly. If the user inputs something incorrect, correct them and loop the menu and prompt. Welcome to Assignment 3! Menu: 11D Math 2 Single Dimension Character Processing 3 Two-D Character Processing 4-Exit Choose an option: Part 1-ID Math Write a function to drive part 1. Write several other functions to complete each task A-Fill the Array Ask the user for a size and dynamica11y allocate an integer array based on that size. Ask the user for a minimum integer and a maximum integer. Fi11 the array with random integers between the minimum value and maximum value entered. Sort it! (see extra credit opportunity below) Display the contents of the array. Calculate and output: The average of the array .The median of the array The number of unique (non-repeated) numbers in the array The number of numbers that were duplicated o Note: how many are duplicated, not how many duplicates are there C - Processing) Menu Option1 - Get a character from the user. Either safety-check it, or force it to be lower- case. Create a function that returns an integer. This function should take the array, the letter and the size. Prototype: int getFrequencyOf (char letters*, int size, char item); You will loop through the array and count each matching instance of the character the user inputted. Return the final count. Output the result and ask if they want to do another process. Menu Option 2 - Get a character from the user. Either safety-check it, or force it to be lower- case Create a function that will remove ALL instances of the specified character from your array. Prototype: void removeCharacter (char letters, int size, char item); This should not leave gaps in your array. Make sure you shuffle down' the contents of the array to fill in the gaps. Make sure you properly place the 10 After processing the array, output the array with a printf("%s") statement to prove you processed it correctly Ask if they want to do another process. Menu Option 3 - Write a function to sort the array alphabetically. Prototype: void sortArray (char letters*, int size); NOTE Think about when this might be called. Has the user removed any letters? Extra Credit opportunity +3 points There are two sorts that needs to happen, integer sorting and character sorting Code Quick Sort, Shel1 Sort or Merge Sort to do your sorting. You can easily copy/paste your sort function and change the data types so you can sort either. Sample Output Welcome to Assignment 3! Menu: 1- 1D Math 2-Single Dimension String Processing -Two-D String Processing 4Exit Choose an option: User choose 1 Choose an option: 1 enter size: 21 min: 1 max: 50 2 3-7 -7-8-11 - 13 -13 - 14- 14 - 15 - 20 -21 - 22- 26 - 36-41 - 42 - 44 - 45 - 47] Average: 21.4762 Median: 15 Uniques: 18 Non-Uniques: 3 User chooses option 2: Choose an option: 2 How many characters? 60 Filling the array! phqghumeaylnlfdxfircvscxggbwkfnqduxwfnfozvsrtkjprepggxrpnrvystmwc What would you like to do? Check frequency of a letter Remove a letter Sort Return to Main Menu User chooses 1: >? 1 What letter? g There are 5 of the letter g (take the user back to the menu) User chooses 2: >>? 2 What letter? g phqhumeaylnlfdxfircvscxbwkfnqduxwfnfozvsrtkjprepxrpnrvystmwc g has been removed (take the user back to the menu) User chooses 3: >? 3 Sorting! abcccddeefffffhhijkkl1mmnnnnoppppqqrrrrrsssttuuvvvwwwxxxxyyz (take the user back to the menu)

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

Question

-0.3 + 7 Find the sum by hand.

Answered: 1 week ago