Answered step by step
Verified Expert Solution
Question
1 Approved Answer
follow the requirement to write a c program. thankyou very much Write a program to create random sentences. Read from an input file that contains
follow the requirement to write a c program.
thankyou very much
Write a program to create random sentences. Read from an input file that contains article, nouns, verbs, and prepositions. An example input file 10 Articles 5 the a one some any Nouns 5 boy girl dog town car VerbS 5 drove jumped ran walked skipped Prepositions 5 to from over under on The first integer in the file (10 in the example) specifies the number of sentences to generate. The rest of the input file has sections for each part of speech (your code needs to handle these being in any order). The first string will specify the part of speech ("Articles" in the example) and an integer specifying the number of that type of word that is on the next line (5 in the example). You may assume no word in the file is over 75 characters long The words given for each part of speech are to be stored in a dynamically allocated array of strings (a "jagged" 2D array). Thus assuming the input file above, an array called articles would look like this a 1o 0 Each of these arrays (articles, nouns, verbs, prepositions) should be displayed in alphabetical order (implement your choice of sorting algorithm). After the arrays are set up and sorted, generate the random sentences and display them numbered. Example output (you do not have to match this format)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started