the program will read the data from the text file and use them to calculate the number of rating and percentage of rating.
please make the program easy not complex.
a c++ program that use arrays, functions and text file has the information.
the text file has a name of hotel and rating in stars:
serr *
dani ***
serr **
defo ****
defo **
serr *
dani ***
serr **
defo ****
defo **
each * = one point.
txt is containing 10 records, so you may declare array size as 10 as a global variable
the program will read the data from the text file and use them to calculate the number of rating and percentage of rating.
first function : a void fnc/ receives two arrays to read data from the txt file, string array holds the names of the hotels and an integer array holds the points, and count variable with reference gets the number of records added from file to array.
second function : void fnc / computes and prints the rating for each hotel by adding all its points then dividing by number of times it has been rated.
Step by step
Solved in 3 steps with 6 images