急需帮助 高手来解决下把!
Write a program that can read a string and calculates how many words , letters , and lines there are . The program is in 3 parts: Part 1 : Basic Program
1. Program finds out how many words are in a string
2. Finds out the following:
1. How many words are in the string
2. How many letters are in the string
3. The word with the most letters
4. The word with the lowest number of letters
5. The average number of letters per word
3. Displays a report about everything above
Part 2 : Change the above program:
1. The program reads a string from a file instead
2. The report is written to a file
3. Count how many lines are in the program
4. Calculate the average number of words of words per line there are
5. Calculate the average number of letters per line there are
Part 3 : Change the above program :
1. Build a calculator program :
1. The user selects what they want to do : Read the file , or perform mathematics
2. In the mathematics section , the user selects what operation they want to do
3. They then enter the numbers and the answer is displayed
Extra Marks :
You will get extra marks if you can program any of the following:
Have a menu system that allows the user to keep using the program until they say stop
Part 1 :Count how many times each letter of the alphabet occurs
Count how many times the words“Dog” “Cat” “Pig” ,“Chinchilla” appear in the string
Part 2 : Write the report file as a web-page
Say what lines the words“Dog” “Cat” , “Pig” ,“Chinchilla” are in
Each Extra part will gain you 5 extra marks .
The program must use the following function :
Part 1 : 40%
●Functions 10 marks
●Pass variables| pointers 5 marks
●Return variables| pointers 5 marks
●For loops 5 marks
●While OR Do…while loops 5 marks
●Scanf 5 marks
●Switch statements 5 marks
●If statements 5 marks
●Arrays 5 marks
●Pointers 5 marks
●Comments 5 marks
● Part 1 works 20 marks Total :80 marks
Part 2 :40%
●File Input 20 marks
●File Output 20 marks
●Structures 10 marks
●Error Checking 10 marks
● Part 2 works 20 marks Total:80 marks
Part 3: 20%
●Calculator program 30 marks
●Menu system 5 marks
●Math Library Function 5 marks each (Maximum of 3 functions)
●Part 3 works 10 marks Total : 60 marks
If you demonstrate each function 2 or more times you will be awarded the full amount of marks for that function .