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
icon
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
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
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

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Binary numbers
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.
Similar questions
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education