Reference no: EM134044845
Software Development Fundamentals
Practical B
Practical B - Loops, Arrays, Modular Programming and Strings
This practical assesses Sessions 4 to 7: loop constructs, one-dimensional and multidimensional arrays, modular programming, methods and string processing.
Question 1 - Student Marks Analyser
Ask the user how many marks will be entered, then use a loop to read and store valid marks from 0 to 100 in a list.
Create separate functions to calculate the average, highest mark, lowest mark, number of passes and number of fails. Display all results clearly.
The program must reject an invalid list size and must repeatedly request a mark when a value outside 0 to 100 is entered.
Question 2 - String Analysis Toolkit
Write a function named analyse_text(text) that returns the number of words, vowels, digits and alphabetic characters in a sentence.
Write a second function that determines whether the text is a palindrome after spaces and letter case have been ignored. Test the functions with two different strings.
Question 3 - Inventory Search and Update
Store at least five products in a two-dimensional list. Each product must contain a product code, product name, unit price and quantity.
Create functions to display all products, search by product code, and update the quantity. Use a loop-driven menu that continues until the user chooses to exit.
The program must handle an unknown product code, a negative quantity and an invalid menu option without crashing.
Test Practical B with representative normal, boundary and invalid-input cases. For additional support with Introduction To Programming, students can refer to the relevant programming resources.