For completion of the program, arrays and files.Instead of …

For completion of the program, arrays and files. Instead of prompting the user for the prices of the book, the website program to reflect the following changes: a 1/2- to 1-page document containing pseudocode based on the revised program needs. Replace the pseudocode statements in the existing pseudocode program. a 1- to 2-page flowchart based on the algorithm for the revised program needs. Replace the flowchart structure in the existing flowchart for the program. your assignment using the Assignment Files tab.

Title: Pseudocode and Flowchart for Program Modification

Introduction:
This paper provides pseudocode and a flowchart for modifying an existing website program. The aim of the modification is to replace the user prompt for book prices with an automated system that reads data from arrays and files. The revised program will improve efficiency and reduce the reliance on user input for book pricing.

Pseudocode:

1. Start program
2. Declare and initialize the following variables:
– bookTitles: Array of strings to store the titles of the books
– bookPrices: Array of floats to store the prices of the books
– fileContent: String to store the content read from the file

3. Read book titles and prices from the file:
a. Open the input file
b. While there is still content in the file, do the following:
– Read the title from the file and store it in the bookTitles array
– Read the price from the file and store it in the bookPrices array

4. Display a menu to the user with the following options:
– Search book by title
– Display all books
– Exit

5. Read user choice
6. Switch based on the user’s choice:
a. Case ‘Search book by title’:
– Read the title of the book the user wants to search for
– Iterate over the bookTitles array to find a match:
– If a match is found, display the corresponding book title and price
– Otherwise, display a message indicating that the book was not found

b. Case ‘Display all books’:
– Iterate over the bookTitles and bookPrices arrays simultaneously
– Display each book title along with its corresponding price

c. Case ‘Exit’:
– Display a farewell message and end the program

7. End program

Flowchart:
(Note: The flowchart uses standard symbols and conventions for flowcharts)

[Start] -> [Declare and initialize variables] -> [Read book titles and prices from file] -> [Display menu] ->
-> [Read user choice] -> [Switch based on choice] ->
– [Case ‘Search book by title’] ->
-> [Read title to search for] -> [Iterate over bookTitles array] ->
-> [Is title found?] ->
– [Yes] -> [Display book title and price]
– [No] -> [Display book not found]
– [Case ‘Display all books’] ->
-> [Iterate over bookTitles and bookPrices arrays] -> [Display book title and price]
– [Case ‘Exit’] -> [Say farewell and end program]

[End]

Conclusion:
The provided pseudocode and flowchart outline the modifications needed to replace the user prompt for book prices with automated processes using arrays and files. This approach will enhance the program’s efficiency and reduce reliance on manual input. By following the outlined steps in the revised program, users will be able to search for books by title, view all books with their corresponding prices, and exit the program when desired. The modifications will significantly improve the overall functionality and usability of the program.