Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Which of the following items are non - local references in the following C program? 1 #include 2 3 enum houses { GRYFFINDOR , RAVENCLAW,

Which of the following items are non-local references in the following C program?
1 #include
2
3 enum houses {GRYFFINDOR, RAVENCLAW, SLYTHERIN, HUFFLEPUFF};
4
5 int pointsMultiplier =10;
6
7 int calcPoints(int points){
8 return (points * pointsMultiplier);
9}
10
11 int CalcPointsForHouse(enum houses house, int points){
12 int finalPoints =0;
13 if (house == GRYFFINDOR){
14 pointsMultiplier =2;
15}
16 else if (house == SLYTHERIN){
17 pointsMultiplier =1;
18}
19 else if (house == RAVENCLAW){
20 pointsMultiplier =3;
21}
22 else {
23 int pointsMultiplier =4;
24 finalPoints = calcPoints(points);
25 return finalPoints;
26}
27
28 finalPoints = calcPoints(points);
29
30 return finalPoints;
31}
32
33 int main(){
34 int housePoints =50;
35 int finalPoints =0;
36
37 finalPoints = CalcPointsForHouse(HUFFLEPUFF, housePoints);
38 printf("Hufflepuff: %d
", finalPoints);
39
40 pointsMultiplier =3;
41 finalPoints = calcPoints(housePoints);
42 printf("Ravenclaw: %d
", finalPoints);
43
44 return 0;
45}
Group of answer choices
points (line 8)
pointsMultiplier (line 8)
pointsMultiplier (line 20)
finalPoints (line 24)
points (line 24)
finalPoints (line 28)
points (line 28)
finalPoints (line 37)
housePoints (line 37)
pointsMultiplier (line 40)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

Their computer is similar ours.

Answered: 1 week ago