Need help with "Error no operator matches these operands"

I am experiencing these errors and I have no idea how to get them solved.
Please help. Thank you so much.

My codes:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <iostream>
#include <iomanip>
using namespace std;

struct classroomType
{
	string classroomID;
	string classroomName;
	double rentalFees;
};

classroomType classrooms[20];

double getRentalFees(string); 

int main()
{
	classrooms[0].classroomID = "CR001";
	classrooms[1].classroomID = "CR002";
	classrooms[2].classroomID = "CR003";

	classrooms[0].classroomName = "Apple";
	classrooms[1].classroomName = "Banana";
	classrooms[2].classroomName = "Caramel";

	classrooms[0].rentalFees = 30.00;
	classrooms[1].rentalFees = 45.00;
	classrooms[2].rentalFees = 60.00;

	string ID;
	double revised;
	
	cout << "Enter classroom: ";
	cin >> ID;     //error here
	double status = getRentalFees(ID);

	if (status == 0.0)
	{
		cout << "Record not found" << endl;
	}

	else 
	{
		cout <<"Please enter revised rental fees" << endl;
		cin >> revised;

		if(revised < status)
		{
			cout << "Entered fees is lower than the existing fees." << endl;
		}
		else if(revised > status)
		{
			cout << "Revised fees is $" << revised << endl;
		}
	}
	return(0);
}

	double getRentalFees(string name)
	{
		int status;

		for (int i=0;i<20;i++)
		{
			if (classrooms[i].classroomID != name) //error here
			status = 0.0;
			return (status);

			if (classrooms[i].classroomID == name) //error here
			status = classrooms[i].rentalFees;
			return (status);
		}
	}


Last edited on
#include <string>, perhaps?
A couple other issues:
Line 61. status should be double.

Line 73: What is returned if you fall through the loop?
Topic archived. No new replies allowed.