Please Help (Pt 2) Lol


So I changed some things around and now this is the Error I get when trying to compile...

TP.cc:15:9: error: missing terminating " character
TP.cc:15: error: missing terminating " character
TP.cc: In function âint main()â:
TP.cc:27: error: expected primary-expression before âifâ
TP.cc:27: error: expected `;' before âifâ








#include <iostream>
using namespace std;

int main()
{

char get_call_period; // To get Call period D/day E/EveningW/NightNWknds
double get_call_duration; // To get call dur in mins and secs.
double compute_call_cost; // To calculate the cost of the call.
double report_call_cost; // Report the total converted cost back to the user.

//This will display the company of the telephone service as well as the ver,
// and my name, copyright, and date.

cout << "High-Strung Long-Distance Telephone Service Program, version";
cout << "1.0" << endl;
cout << "(C) Josh Preston 2011" << endl;
cout << " Enter the period, either N, D or W for Weekends and nights "
<< endl;
cin >> get_call_period;
cout << "Enter the duration of the call in minutes: " << endl;
cin >> get_call_duration;


// Determine the period of the call and calculate for N and W.

--- if (get_call_period == 'W')
--- {
--- report_call_cost = (get_call_duration * .4);
---
--- }
---
--- if (get_call_period == 'D')
--- {
--- if (get_call_duration > 0 && get_call_duration <=3)
--- {
--- report_call_cost = (get_call_duration + .33);
--- }
--- report_call_cost = (get_call_duration * 9);
--- }
---
--- if (get_call_period == 'E')
--- {
--- report_call_cost = (get_call_duration * 7);
--- }

cout << "Your " << get_call_duration << "minute " << get_call_period << "call will cost: " << report_call_cost << endl;


return 0;
}




Last edited on
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
#include <iostream>
using namespace std;

int main()
{

char get_call_period; // To get Call period D/day E/EveningW/NightNWknds
double get_call_duration; // To get call dur in mins and secs.
double compute_call_cost; // To calculate the cost of the call.
double report_call_cost; // Report the total converted cost back to the user.

//This will display the company of the telephone service as well as the ver,
// and my name, copyright, and date.

cout << "High-Strung Long-Distance Telephone Service Program, version";
cout << "1.0" << endl;
cout << "(C) Josh Preston 2011" << endl;
cout << " Enter the period, either N, D or W for Weekends and nights "
<< endl;
cin >> get_call_period;
cout << "Enter the duration of the call in minutes: " << endl;
cin >> get_call_duration;


// Determine the period of the call and calculate for N and W.

if (get_call_period == 'W')
{
report_call_cost = (get_call_duration * .4);
}

if (get_call_period == 'D')
{
if (get_call_duration > 0 && get_call_duration <=3)
{
report_call_cost = (get_call_duration + .33);
}
report_call_cost = (get_call_duration * 9);
}

if (get_call_period == 'E')
{
report_call_cost = (get_call_duration * 7);
}

cout << "Your " << get_call_duration << "minute " << get_call_period << "call will cost: " << report_call_cost << endl;


return 0;
}


this isnt my response i just need to read your code easier
Last edited on
im pretty sure that --- isn't helping
Topic archived. No new replies allowed.