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
____ [38]
4 years ago
13

Write a C++ program to display yearly calendar. You need to use the array defined below in your program. // the first number is

the month and second number is the last day of the month. into yearly[12][2] =
Engineering
1 answer:
ddd [48]4 years ago
3 0

Answer:

//Annual calendar

#include <iostream>

#include <string>

#include <iomanip>

void month(int numDays, int day)

{

int i;

string weekDays[] = {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"};

// Header print

      cout << "\n----------------------\n";

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

{

cout << left << setw(1) << weekDays[i];

cout << left << setw(1) << "|";

}

cout << left << setw(1) << "|";

      cout << "\n----------------------\n";

      int firstDay = day-1;

      //Space print

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

          cout << left << setw(1) << "|" << setw(2) << " ";

      int cellCnt = 0;

      // Iteration of days

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

      {

          //Output days

          cout << left << setw(1) << "|" << setw(2) << i;

          cellCnt += 1;

          // New line

          if ((i + firstDay-1) % 7 == 0)

          {

              cout << left << setw(1) << "|";

              cout << "\n----------------------\n";

              cellCnt = 0;

          }

      }

      // Empty cell print

      if (cellCnt != 0)

      {

          // For printing spaces

          for(int i=1; i<7-cellCnt+2; i++)

              cout << left << setw(1) << "|" << setw(2) << " ";

          cout << "\n----------------------\n";

      }

}

int main()

{

int i, day=1;

int yearly[12][2] = {{1,31},{2,28},{3,31},{4,30},{5,31},{6,30},{7,31},{8,31},{9,30},{10,31},{11,30},{12,31}};

string months[] = {"January",

"February",

"March",

"April",

"May",

"June",

"July",

"August",

"September",

"October",

"November",

"December"};

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

{

//Monthly printing

cout << "\n Month: " << months[i] << "\n";

month(yearly[i][1], day);

if(day==7)

{

day = 1;

}

else

{

day = day + 1;

}

cout << "\n";

}

return 0;

}

//end

You might be interested in
Which term describes erosion?
Vera_Pavlovna [14]

Answer:

transports solid materials

7 0
3 years ago
Read 2 more answers
3. (5%) you would like to physically separate different materials in a scrap recycling plant. describe at least one method that
Likurg_2 [28]

One of the methods that are used to separate polymers, aluminium alloys, and steels from one another is the Gravitation Separation method.

One straightforward technique is to run the mixture through a magnet, which will keep the steel particles on the magnet and separate them from the polymer.

What is the Gravitation Separation method?

When it is practicable to separate two components using gravity, i.e., when the combination's constituent parts have different specific weights, gravity separation is a technique used in industry. The components can be in suspension or in a dry granular mixture.

Polymers, Steel and Aluminium alloys can be readily split apart. The technique depends on how the two components are combined. The approach used is gravitational density. Due to the significant difference in relative specific mass values between steel and polymers (which range from 1.0 to 1.5), it is possible to separate them using flotation in a liquid that is safe and has the right density.

Therefore, the Gravitation Separation method is used to separate polymers, aluminium alloys and steels.

To learn more about the Polymer from the given link

brainly.com/question/2494725

#SPJ4

8 0
2 years ago
For laminar flow over a hot flat plate, the local heat transfer coefficient decreases with distance because (select all that are
kotegsom [21]

Answer:

B. The thickness of the heated region near the plate is increasing.

Explanation:

First we know that, a boundary layer is the layer of fluid in the immediate vicinity of a bounding surface where the effects of viscosity are significant. The fluid is often slower due to the effects of viscosity. Advection i.e the transfer of heat by the flow of liquid becomes less since the flow is slower, thereby the local heat transfer coefficient decreases.

From law of conduction, we observe that heat transfer rate will decrease based on a smaller rate of temperature, the thickness therefore increases while the local heat transfer coefficient decreases with distance.

3 0
4 years ago
Connecting rods undergo a process to alleviate manufacturing stresses from forging, a process known as ______.​
DiKsa [7]
I believe it is cold forging?

sorry this answer was very confusing.
4 0
3 years ago
How does refrigeration preserve food and dead bodies​
algol [13]

Answer:

The Purpose of Refrigeration. The fundamental reason for having a refrigerator is to keep food cold. Cold temperatures help food stay fresh longer. The basic idea behind refrigeration is to slow down the activity of bacteria (which all food contains) so that it takes longer for the bacteria to spoil the food.

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • You want a potof water to boil at 105 celcius. How heavy a
    11·1 answer
  • Imagine you are designing a new backpack. Which of the following statement(s) about
    5·2 answers
  • In a given rocket engine, a mass flow of propellants equal to 87.6 lbm/s is pumped into the combustion chamber, where the stagna
    13·1 answer
  • A heat pump is to be used to heat a house in winter and then reversed to cool the house in summer. The interior space is to be m
    13·2 answers
  • A 10-mm steel drill rod was heat-treated and ground. The measured hardness was found to be 290 Brinell. Estimate the endurance s
    14·1 answer
  • Two technicians are discussing catalytic converters. Technician A says that the exhaust mixture must fluctuate between rich and
    8·1 answer
  • 8. What is the proper name of this starting system used on selected vertical crankshaft engines? Click here to enlarge image Sup
    12·1 answer
  • You are using a Jupyter Notebook to explore data in a DataFrame named productDF. You want to write some inline SQL by using the
    8·1 answer
  • What truck you like the best
    9·2 answers
  • Which of the following procedures best applies to assessing the embodied energy of a building?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!