strng ownerliane; string breed; num ownerId; num age; num weight; num weeklyFee; cout « "Please enter owner's ID:"; cin >> ownerId; cout « "Please enter owner's name:" cin >> ownerNane; cout « "Please enter dog's breed"; cin >> breed cout « "Please enter dog's age:" cin >> age; cout « "Please enter dog's weight"; cin >> weight; if (weight < 15) weeklyFee - 5s.00; else if(weight >» 15) and (weight <= 30) weeklyfee- 75.00; else if(weight > 30) and (weight <= 80) weeklyFee - 1es.ee; else() weeklyfee- 125.00; cout <« "Owner Name:" cin >> ownerNane; cout « "Owner ID:"; cin >> ownerId; cout c "Dog Breed:"; cin >> breed; cout « "Dog Age:"; cin >> age; cout « "Dog Height:"; cin >> weight; cout ce "Weekly Fee:"; cin >> weeklyFee; return e;
strng ownerliane; string breed; num ownerId; num age; num weight; num weeklyFee; cout « "Please enter owner's ID:"; cin >> ownerId; cout « "Please enter owner's name:" cin >> ownerNane; cout « "Please enter dog's breed"; cin >> breed cout « "Please enter dog's age:" cin >> age; cout « "Please enter dog's weight"; cin >> weight; if (weight < 15) weeklyFee - 5s.00; else if(weight >» 15) and (weight <= 30) weeklyfee- 75.00; else if(weight > 30) and (weight <= 80) weeklyFee - 1es.ee; else() weeklyfee- 125.00; cout <« "Owner Name:" cin >> ownerNane; cout « "Owner ID:"; cin >> ownerId; cout c "Dog Breed:"; cin >> breed; cout « "Dog Age:"; cin >> age; cout « "Dog Height:"; cin >> weight; cout ce "Weekly Fee:"; cin >> weeklyFee; return e;
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
I am trying to conver pseudocode into code but keep running into errors. Currently I am stuck with an error based on placement of semicolons. Any help would be appreciated.
![77 Start
/ Declarations
2
number id
string ownerName
string breed
number age
3
4
//
5
//
6
//
number weight
number weeklyFee
7
//
8
9
//
10
// output "Please enter owner 's ID:"
// input id
output "PLease enter owner's name:"
11
12
//
input ownerName
output "Please enter dog's breed (no space in input, use instead; for example Great_Dane):"
input breed
/ output "PLease enter dog 's age:"
// input age
// output "Please enter dog 's weight:"
/ input weight
// if (weight < 15)
13
//
14
//
15
16
17
18
19
20
weeklyFee = 55.00
else if ((weight >= 15) and (weight <= 30))
weeklyFee = 75.00
21
//
22
//
23
//
24
/ else if ((weight > 30) and (weight <= 80))
25
//
weeklyFee = 105.00
26
// else
27
//
weeklyFee = 125.00
28
//
29
//
output "Owner Name:", ownerName
/ output "Owner ID:", id
// output "Dog Breed:", breed
// output "Dog Age: ", age
/ output "Dog Weight:", weight
// output "Weekly Fee:", "$",weeklyFee
// Stop
30
31
32
33
34
35
36
37
#include <iostream>
38
#include <string>
39
40
using namespace std;
41
42
int main()
43
{
int num,
string ownerName;
string breed;
num ownerI%;
44
45
46
48
num age;
num weight;
num weeklyFee;
49
50
urces dlh Compile Log V Debug a Find Results Close
Message
In function 'int main0':
[Error] expected ';' before 'ownerld'
[Error] expected ';' before 'age'
[Error] expected ';' before 'weight'
[Error] expected ';' before 'weeklyFee'
[Error] 'ownerld' was not declared in this scope
[Error] expected ':' before 'cout'
----i- : 0016 cecends](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8ca68b71-7152-4fba-b78b-fb62854bc44f%2Fda3729c2-39b6-4e2a-9157-133dc4bf07e2%2Fdwnyp42_processed.png&w=3840&q=75)
Transcribed Image Text:77 Start
/ Declarations
2
number id
string ownerName
string breed
number age
3
4
//
5
//
6
//
number weight
number weeklyFee
7
//
8
9
//
10
// output "Please enter owner 's ID:"
// input id
output "PLease enter owner's name:"
11
12
//
input ownerName
output "Please enter dog's breed (no space in input, use instead; for example Great_Dane):"
input breed
/ output "PLease enter dog 's age:"
// input age
// output "Please enter dog 's weight:"
/ input weight
// if (weight < 15)
13
//
14
//
15
16
17
18
19
20
weeklyFee = 55.00
else if ((weight >= 15) and (weight <= 30))
weeklyFee = 75.00
21
//
22
//
23
//
24
/ else if ((weight > 30) and (weight <= 80))
25
//
weeklyFee = 105.00
26
// else
27
//
weeklyFee = 125.00
28
//
29
//
output "Owner Name:", ownerName
/ output "Owner ID:", id
// output "Dog Breed:", breed
// output "Dog Age: ", age
/ output "Dog Weight:", weight
// output "Weekly Fee:", "$",weeklyFee
// Stop
30
31
32
33
34
35
36
37
#include <iostream>
38
#include <string>
39
40
using namespace std;
41
42
int main()
43
{
int num,
string ownerName;
string breed;
num ownerI%;
44
45
46
48
num age;
num weight;
num weeklyFee;
49
50
urces dlh Compile Log V Debug a Find Results Close
Message
In function 'int main0':
[Error] expected ';' before 'ownerld'
[Error] expected ';' before 'age'
[Error] expected ';' before 'weight'
[Error] expected ';' before 'weeklyFee'
[Error] 'ownerld' was not declared in this scope
[Error] expected ':' before 'cout'
----i- : 0016 cecends
![string ownerName;
string breed;
46
num ownerId;
48
num age;
num weight;
num weeklyFee;
49
50
51
52
cout <« "Please enter owner's ID:";
cin >> ownerId;
cout << "Please enter owner's name:";
cin >> ownerName;
cout <«< "Please enter dog's breed";
cin >> breed
53
54
55
57
58
cout <«< "Please enter dog's age:";
cin >> age;
cout <« "Please enter dog's weight";
cin >> weight;
61
62
63
if (weight < 15)
64
65
weeklyFee = 55.00;
66
}
else if(weight >= 15) and (weight <= 30)
{
weeklyFee = 75.00;
67
68
69
70
}
else if(weight > 30) and (weight <= 8e)
71
72
73
weeklyFee = 105.00;
74
75
else()
76
{
weekly
77
= 125.00;
78
79
80
cout <«< "Owner Name:";
cin >> ownerName;
cout <« "Owner ID:";
cin >> ownerId;
cout <« "Dog Breed:";
cin > breed;
cout <« "Dog Age:";
cin >> age;
cout <« "Dog Weight:";
cin >> weight;
81
82
83
84
85
86
87
88
89
90
cout <« "Weekly Fee:";
cin >> weeklyFee;
91
92
93
return 0;
94
urces dh Compile Log V Debug a Find Results 3 Close
Message
In function 'int main(0':
[Error] expected ';' before 'ownerld'
[Error] expected ';' before 'age'
[Error] expected ;' before 'weight'
[Error] expected ';' before 'weeklyFee'
rror] 'ownerld' was not declared
this scope
[Error] expected ':' before 'cout'
1879
Insert
Done narsing in 0.016 seconds](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8ca68b71-7152-4fba-b78b-fb62854bc44f%2Fda3729c2-39b6-4e2a-9157-133dc4bf07e2%2Fhs5ajul_processed.png&w=3840&q=75)
Transcribed Image Text:string ownerName;
string breed;
46
num ownerId;
48
num age;
num weight;
num weeklyFee;
49
50
51
52
cout <« "Please enter owner's ID:";
cin >> ownerId;
cout << "Please enter owner's name:";
cin >> ownerName;
cout <«< "Please enter dog's breed";
cin >> breed
53
54
55
57
58
cout <«< "Please enter dog's age:";
cin >> age;
cout <« "Please enter dog's weight";
cin >> weight;
61
62
63
if (weight < 15)
64
65
weeklyFee = 55.00;
66
}
else if(weight >= 15) and (weight <= 30)
{
weeklyFee = 75.00;
67
68
69
70
}
else if(weight > 30) and (weight <= 8e)
71
72
73
weeklyFee = 105.00;
74
75
else()
76
{
weekly
77
= 125.00;
78
79
80
cout <«< "Owner Name:";
cin >> ownerName;
cout <« "Owner ID:";
cin >> ownerId;
cout <« "Dog Breed:";
cin > breed;
cout <« "Dog Age:";
cin >> age;
cout <« "Dog Weight:";
cin >> weight;
81
82
83
84
85
86
87
88
89
90
cout <« "Weekly Fee:";
cin >> weeklyFee;
91
92
93
return 0;
94
urces dh Compile Log V Debug a Find Results 3 Close
Message
In function 'int main(0':
[Error] expected ';' before 'ownerld'
[Error] expected ';' before 'age'
[Error] expected ;' before 'weight'
[Error] expected ';' before 'weeklyFee'
rror] 'ownerld' was not declared
this scope
[Error] expected ':' before 'cout'
1879
Insert
Done narsing in 0.016 seconds
Expert Solution

Step 1
Correct the given program as follows:
- Use int data type for the variables that will store numeric data.
- Use && operator instead of and operator in the if-else conditions.
- End each statement with a semicolon.
- Do not use empty brackets like () for else statement as no condition is specified for the else statement.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education