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
Travka [436]
3 years ago
12

You will create two classes, one for a box and one for a triangle. Each of the figures, the box and the triangle, will have an o

ffset telling how far they are indented from the edge of the screen. Each figure will also have a size, although the size will be determined differently for a box and a triangle. For a box, the size is given as the width and the height, expressed in the number of characters. Because characters are taller than they are wide, a box will look taller than you might expect when it is written on the screen. For a triangle, the size will be given by its base. The triangle will point up, and the base will be at the bottom. The slope of a side of the triangle is limited to what you get by indenting one character per line. So once the base is chose, you have no choice regarding what the sides of the triangle will be. We also assume that the base size of a triangle must be odd. The following shows a sample of a 5-by-5 box and a triangle with base of size 15. Assuming that the offset 10. The
Computers and Technology
1 answer:
Softa [21]3 years ago
6 0

I believe it should be

You might be interested in
Mechanisms that can be used to rescue accident victims
stiks02 [169]

Answer:

Hydraulic rescue tools

6 0
2 years ago
Write a program that reads a number and prints all of its binary digits: print the remainder number % 2, then replace the number
allsm [11]
If you print the binary digits just like that, they'll be in the wrong order (lsb to msb). Below program uses recursion to print the digits msb to lsb. Just for fun.

void printBits(unsigned int n)
{
   if (n > 1) {
      printBits(n >> 1);
   }
   printf((n & 1) ? "1" : "0");
}

int main()
{
   unsigned int number;
   printf("Enter an integer number: ");
   scanf_s("%d", &number);
   printBits(number);
}

5 0
4 years ago
ABC Resort and Hotel has approached you to write a program to keep track of the number of rooms needed for an event. Customers c
nexus9112 [7]

Answer:

Check the explanation

Explanation:

/ Pseudocode for tracking the reservation of rooms for an event

Declaration

 

  string roomInput;

  string roomNames[4];

  number roomPrice[4];

  number roomCount[4];

  number i;

  boolean roomFound;

  number totalRevenue, avgRevenue;

  number totalRoomsNeeded;

Start

 

  // initialize the room names, and price for each room

  // array index starts from 0 and goes to n-1 where n is the total number of elements in the array

  roomNames[0] = "Single";

  roomNames[1] = "Single Deluxe";

  roomNames[2] = "Double";

  roomNames[3] = "Double Deluxe";

 

  roomPrice[0] = 79.95;

  roomPrice[1] = 99.95;

  roomPrice[2] = 149.95;

  roomPrice[3] = 179.95;

 

  // initialize each room count to 0 at the start

  for(i=0;i<4;i++)

  do

      roomCount[i] = 0;

  end for  

 

  // input the room type, user should type exit to indicate they are done

  Display "Enter room type ('exit' to quit ) : ";

  Input roomInput;

 

  // loop that continues till user types quit

  while(roomInput != "quit")

  do  

      roomFound = false;

      // loop to determine if user input is valid and increment the associated room count

      for(i=0;i<4;i++)

      do

          if(roomNames[i] == roomInput) then

              roomCount[i] = roomCount[i] + 1;

              roomFound = true;

          end if

      end for

     

      // if invalid room type, display error

      if(roomFound == false) then

          Display "Invalid input for Room type. Room type can be Single or Single Deluxe or Double or Double Deluxe ";

      end if  

     

      Display "Enter room type ('exit' to quit ) : ";

      Input roomInput;

  end while

 

  // set totalRevenue and totalRoomsNeeded to 0

  totalRevenue = 0;

  totalRoomsNeeded = 0;

  Display("Room Type Price($) Rooms Needed");

  // loop to display each room type details and calculate the totalRevenue and totalRoomsNeeded

  for(i=0;i<4;i++)

  do

      Display(roomNames[i],roomPrice[i],roomCount[i])

      totalRevenue = totalRevenue + (roomPrice[i]*roomCount[i]);

      totalRoomsNeeded = totalRoomsNeeded + roomCount[i];

  end for  

 

  // calculate average revenue

  if(totalRoomsNeeded > 0) then

      avgRevenue = totalRevenue/totalRoomsNeeded;

  else

      avgRevenue = 0;

  end if

 

  // display the total revenue and average revenue

  Display("Total revenue from all rooms : $",totalRevenue);

  Display("Average revenue from a room : $",avgRevenue);

 

End  

//end of pseudocode

5 0
3 years ago
Write a statement that toggles the value of the bool variable onoffswitch. that is, if onoffswitch is false , its value is chang
choli [55]
You should state the language you're using in these types of questions; here's an example in C++.

bool onOff = true;
if (onOff)
onOff = false;
else
onOff = true;
8 0
3 years ago
Which sign or symbol will you use to lock cells for absolute cell reference?
ivanzaharov [21]
It's asterisk hope this helped
7 0
3 years ago
Read 2 more answers
Other questions:
  • A school librarian has been asked to identify inappropriate Internet usage. Which students would most likely be reported to the
    5·2 answers
  • The key requirement in selection of the facilitator is one who is the end-user.
    8·1 answer
  • Create a "web page" with the following components: An input field for the "number of rounds to play" The "number of remaining" r
    14·1 answer
  • Which of the following statements about these signs is true?
    13·1 answer
  • I thought the answer was senior manager see on google it says
    8·1 answer
  • A quarter of adults have a tablet and half of them own a smartphone.<br> a. True<br> b. False
    7·2 answers
  • Name the type of software which provides the user interface. [1 mark
    5·1 answer
  • What is the command to list files in Unix and Unix like operating system?​
    15·1 answer
  • Write a program that will input miles traveled and hours spent in travel. The program will determine miles per hour. This calcul
    5·1 answer
  • Which of the following is part of the process of publishing a website?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!