Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design a program that can be solved using while loops or for loops ( or both ) and string operations. Your program will process a
Design a program that can be solved using while loops or for loops or both and string operations. Your program will process a long string with a fixed structure, whose parts are separated using specific characters. The string will contain at least five objects of the same kind and use a structure to describe the objects. The program will search through the string, and perform at least two types of operations, one about string operations such as searching for something or encrypting a text, one about performing mathematical computations such as finding the average, total, or largest value etc. Your problem should reflect a realworld operation. Below is an example:
String: John Smith,manager,; Alex Hoover,staff,;Jane Meyer,staff,;
Task : Find if there is an employee named Alex Hoover. If so display all information
Task : Find the average salary of all employees
Other examples:
search for a book in a particular field and find average prices of all books;
Find if there is a movie being played in a theater, and display total income from that movie;
Rubric
Create a function for each task, thus your program will have at least two functions.
The string contains information of at least five objects. The only hard coded value is the initial string value, and the value to search for, such as the employee name, book name, movie name etc. The rest must be retrieved through coding.
Cannot hard code indexes, eg you must use a function or method to retrieve the index of a semicolon.
Must have at least one loop structure.
Have a utility file and group all the function definitions in this file
Program runs successfully and generates correct output
Follow professional coding standards
Use pseudocodes to describe your algorithm design. Same requirements as in Assignment
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