1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
earnstyle [38]
3 years ago
10

What will be displayed after code corresponding to the following pseudocode is run? Main Set OldPrice = 100 Set SalePrice = 70 C

all BigSale(OldPrice, SalePrice) Write "A jacket that originally costs $ " + OldPrice Write "is on sale today for $ " + SalePrice End Program Subprogram BigSale(Cost, Sale As Ref) Set Sale = Cost * .80 Set Cost = Cost + 20 End Subprogram

Computers and Technology
1 answer:
Tatiana [17]3 years ago
7 0

Answer:

A jacket that originally costs $ 100 is on sale today for $ 80                                    

Explanation:

Main : From here the execution of the program begins

Set OldPrice = 100  -> This line assigns 100 to the OldPrice variable

Set SalePrice = 70   -> This line assigns 70to the SalePrice variable

Call BigSale(OldPrice, SalePrice)  -> This line calls BigSale method by passing OldPrice and SalePrice to that method

Write "A jacket that originally costs $ ", OldPrice  -> This line prints/displays the line: "A jacket that originally costs $ " with the resultant value in OldPrice variable that is 100

Write "is on sale today for $ ", SalePrice  -> This line prints/displays the line: "is on sale today for $ " with the resultant value in SalePrice variable that is 80

End Program -> the main program ends

Subprogram BigSale(Cost, Sale As Ref)  -> this is a definition of BigSale method which has two parameters i.e. Cost and Sale. Note that the Sale is declared as reference type

Set Sale = Cost * .80  -> This line multiplies the value of Cost with 0.80 and assigns the result to Sale variable

Set Cost = Cost + 20  -> This line adds 20 to the value of Cost  and assigns the result to Cost variable

End Subprogram  -> the method ends

This is the example of call by reference. So when the method BigSale is called in Main by reference by passing argument SalePrice to it, then this call copies the reference of SalePrice argument into formal parameter Sale. Inside BigSale method the reference &Sale is used to access actual argument i.e. SalePrice which is used in BigSale(OldPrice, SalePrice) call. So any changes made to value of Sale will affect the value of SalePrice

So when the method BigSale is called two arguments are passed to it OldPrice argument and SalePrice is passed by reference.

The value of OldPrice is 100 and SalePrice is 70

Now when method BigSale is called, the reference &Sale is used to access actual argument SalePrice = 70

In the body of this method there are two statements:

Sale = Cost * .80;

Cost = Cost + 20;

So when these statement execute:

Sale = 100 * 0.80 = 80

Cost = 100 + 20 = 120

Any changes made to value of Sale will affect the value of SalePrice as it is passed by reference. So when the Write "A jacket that originally costs $ " + OldPrice Write "is on sale today for $ " + SalePrice statement executes, the value of OldPrice remains 100 same as it does not affect this passed argument, but SalePrice was passed by reference so the changes made to &Sale by statement in method BigSale i.e.  Sale = Cost * .80; has changed the value of SalePrice from 70 to 80 because Sale = 100 * 0.80 = 80. So the output produced is:

A jacket that originally costs $ 100 is on sale today for $ 80                              

You might be interested in
Security and protection as it relates to operating systems is grouped into four categories: Availability, Data integrity, Authen
Ivahew [28]

Answer:

The answer is "Confidentiality".

Explanation:

Data Security is also known as protection against unauthorized computer access, files, and pages through digital information protection. The protection of data also prevents data from bribery.  

  • It applies to both the security of data from unwanted entities being obtained.
  • It allows accessing sensitive data, which may be able to do so.
4 0
3 years ago
What was the best Metal Gear Solid you enjoyed the most?​
kenny6666 [7]

My personal favorite is Metal gear solid 3: <em>Snake eater</em>.

7 0
3 years ago
2 what is deep learning?
lozanna [386]

Answer:

a type of machine learning based on artificial neural networks in which multiple layers of processing are used to extract progressively higher level features from data.

5 0
1 year ago
How to make your nest learning thermostat stop doing something
k0ka [10]

Answer:

You could unplug it? LOL

and get a different thermostat.

Explanation:

Could you mark this answer as brainiest?

Thanks! :)

4 0
3 years ago
can any one tell me the difference between the things showed in the circle i will mark brainiest to the first one
Shalnov [3]

Answer:

The different brainly websites are different because they are associated with different countries. Each country has their own network and internet rules, and Brainly has to comply with each countries rules. Each country gets their own Brainly site. So, Brainly.com is for the US, Brainly.pl is for Poland, etc.

Explanation:

3 0
3 years ago
Other questions:
  • The support group at Universal Containers wants agents to capture different information for product support and inquiry cases. I
    14·1 answer
  • Whereas lines of competition are clearly defined in the more established industries, in the Internet industry they are blurred a
    9·1 answer
  • Fix the 2 error codes.
    14·1 answer
  • why do programs include keyboard shortcuts for certain actions? do you prefer the mouse or the keyboard/ why?
    7·1 answer
  • What is a series of instructions or commands that a computer follows used to create software
    9·1 answer
  • How will you ensure that all of the network's applications and tcp/ip services also support ipv6?
    10·1 answer
  • The video game machines at your local arcade output coupons depending upon how well you play the game. You can redeem 10 coupons
    14·1 answer
  • Networking and telecommunications technologies, along with computer hardware, software, data management technology, and the peop
    5·1 answer
  • How do you get banned? By getting reported? Or do admins watch whats posted?
    9·1 answer
  • Tell the story, step by step, of how your computer finds the CodeHS server,
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!