The scope of a variable declared inside of a function is:a) Local - within that function

b) Within that file only

c) global

Answers

Answer 1
Answer:

Answer:

a

Explanation:

The variable declared is local within that function that is the declared variable is accessible inside that block itself, it cannot be accessible outside the given function.

ex - void add()

{

int a=10,  b=20 , c ;

c = a + b ;

cout << c ;

}

int main()

{

cout << "value for c is :"<< c ;

return 0;

}

Here inside the add function variable a, b,c are declared and initialized inside the function.


Related Questions

Should I get hollow knight, hyper light drifter, Celeste, or stardew valley for switch
Laptop components that can be replaced relatively easily include the ____ and the ____first partscreen power supplyRAM second part hard diskkeyboard touchpad​
3. If B3=6 and D5=8, what would the following function return? IF(B3>D5, "Closed", D5-B3) *A. "Closed"B. -2C. "Open"D. +2
the UDP server described needed only one socket, whereas the TCP server needed two sockets. Why? If the TCP server were to support n simultaneous connections, each from a different client host, how many sockets would the TCP server need?
This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width.(1) Modify the given program to use a loop to output an arrow base of height arrowBaseHeight. (1 pt)(2) Modify the given program to use a loop to output an arrow base of width arrowBaseWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow base. (1 pt)(3) Modify the given program to use a loop to output an arrow head of width arrowHeadWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow head. (2 pts)(4) Modify the given program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue prompting the user for an arrow head width until the value is larger than the arrow base width. (1 pt)while (arrowHeadWidth <= arrowBaseWidth) {// Prompt user for a valid arrow head value}Example output for arrowBaseHeight = 5, arrowBaseWidth = 2, and arrowHeadWidth = 4:Enter arrow base height:5Enter arrow base width:2Enter arrow head width:4********************This is what I have:import java.util.Scanner;public class DrawHalfArrow{public static void main(String[] args){Scanner scnr = new Scanner(System.in);int arrowBaseHeight = 0;int arrowBaseWidth = 0;int arrowHeadWidth = 0;System.out.println("Enter arrow base height:");arrowBaseHeight = scnr.nextInt();System.out.println("Enter arrow base width:");arrowBaseWidth = scnr.nextInt();while (arrowHeadWidth >= arrowBaseWidth){System.out.println("Enter arrow head width:");arrowHeadWidth = scnr.nextInt();} // Draw arrow base (height = 3, width = 2)for(int i=0; i < arrowBaseHeight; ++i){for(int j=0; j < arrowBaseWidth; ++j){System.out.print("*");}System.out.println();}// Draw arrow head (width = 4)for(int i=0; i < arrowHeadWidth; ++i){for(int j=0; j < arrowHeadWidth-i; ++j){System.out.print("*");}System.out.println();}return;}}

Which statement is written correctly?

Answers

Answer:

B.

Explanation:

In Javascript, the if should have a condition attached to it with parenthesis and curly braces.

Does the following code return a string or a number def of() return 3

Answers

Answer:

The system cannot find the path specified.

Explanation:

please give brain thx! :D

good luck!

Host A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 126. Suppose Host A then sends two segments to Host B back-to-back. The first and second segments contain 80 and 40 bytes of data, respectively. In the first segment, the sequence number is 127, the source port number is 302, and the destination port number is 80. Host B sends an acknowledgment whenever it receives a segment from Host A. In the second segment sent from Host A to B, what are the sequence number, source port number, and destination port number?

Answers

Answer:

sequence number = 207

source port number = 302

destination port number = 80

Explanation:

The sequence number is 127 + 80 = 207

The source port number is 302, and the destination port number is 80.

Assume: Memory: 5 bit addresses Cache: 8 blocks All memory locations contain valid data If the memory location is 9. What is the Binary Address and cache block # If the memory location is 12. What is the Binary Address and cache block # If the memory location is 15. What is the Binary Address and cache block #

Answers

Answer:

The answer to this question can be described as follows:

binary address: 01001, 01100, 01111.

Cache block: 1, 4, 7

Explanation:

Given values

Memory = 5 bit and cache = 8 blocks

Option 1)

memory location is =9

convert into binary number, so we get binary address = 01001

So, the cache block = 1

Option 2)

memory location is = 12

convert into binary number, so we get binary address = 01100

So, the cache block = 4

Option 3)

memory location is =15

convert into binary number, so we get  binary address = 01111

So, the cache block = 7

The ticketing system at the airport is broken, and passengers have lined up to board the plane in the incorrect order. This line is represented in an ArrayList tickets in the AirLineTester class. Devise a way to separate passengers into the correct boarding groups. Currently, there is an AirlineTicket class that holds the information for each passengers ticket. They have a name, seat, row, and boarding group. Use the TicketOrganizer class to help fix the order of passengers boarding. First, create a constructor that takes an ArrayList of AirLineTickets and copies it to a class variable ArrayList. Then, create a getTickets method to get the ArrayList of AirLineTickets. In the TicketOrganizer class, create a method called printPassengersByBoardingGroup that prints out the name of the passengers organized by boarding group. The boarding groups go from 1-5, and have been predetermined for you. This should print the boarding group followed by all passengers in the group:

Answers

Answer:

See explaination

Explanation:

The program code

import java.util.ArrayList;

public class Main

{

public static void main(String[] args)

{

ArrayList<AirlineTicket> tickets = new ArrayList<AirlineTicket>();

//This creates a randomized list of passengers

addPassengers(tickets);

for(AirlineTicket elem: tickets)

{

System.out.println(elem);

}

//This creates a TicketOrganizer object

TicketOrganizer ticketOrganizer = new TicketOrganizer(tickets);

//These are the methods of the ticketOrganizer in action

System.out.println("\nPassengers Ordered by Boarding Group:");

ticketOrganizer.printPassengersByBoardingGroup();

System.out.println("\nPassengers in line who can board together:");

ticketOrganizer.canBoardTogether();

}

//Do not touch this method! It is adding random passengers to the AirlineTicket array

public static void addPassengers(ArrayList<AirlineTicket> tickets)

{

String[] seats = {"A","B","C","D","E","F"};

for(int index = 0; index< 15; index++)

{

int random = (int)(Math.random() * 5);

AirlineTicket ticket = new AirlineTicket("Passenger " + (index+1), seats[random], ((int)(Math.random()*5)+1), ((int)(Math.random()*8)+1));

tickets.add(ticket);

}

}

}

class TicketOrganizer

{

private ArrayList<AirlineTicket> tickets ;

//constructor with parameter as an arraylist of AirlineTicket

public TicketOrganizer(ArrayList<AirlineTicket> tickets)

{

this.tickets = tickets;

}

//methhods to return the arraylist of airlines

public ArrayList<AirlineTicket> getTickets()

{ //re-organize the ticket first

ArrayList<AirlineTicket> tickets_organized = new ArrayList<AirlineTicket>();

for(int i=1; i<=5; i++)

{

for(AirlineTicket ticket: tickets)

{

if(ticket.getBoardingGroup() == i)

{

tickets_organized.add(ticket);

}

}

}

return tickets_organized;

}

//print the tickets based on boardingGroup

public void printPassengersByBoardingGroup()

{

int count = 0;

for(int i=1; i<=5; i++)

{

System.out.println("Boarding Group " + i + ":");

for(AirlineTicket ticket : tickets)

{

if(ticket.getBoardingGroup() == i)

{

System.out.println("Passenger " + ticket.getName());

}

}

}

See attachment for sample output

Corey set up his presentation for delivery to his team.

Answers

Answer:

If Corey wants to control the pacing of his presentation, he should adjust his playback settings. In the playback settings, he should select the default setting under "type;" this will allow him to change slides anytime. He should also click the check box under "options" that says "Change slides manually" so he can simply click on the slide whenever he is ready to move on to another slide.

Explanation:

If you don't like that answer, here's another one:

Corey knew he would need a lot of time to explain each point and that his team members would have lots of comments and questions. The best way that Corey should set up his slide show would be to make sure that he has an outline. Also, there should only be one thought per slide (never mix it). It has to be taken into account that he should have fewer words and more images/graphs.