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]
3 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]3 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
A four-cylinder, four-stroke internal combustion engine has a bore of 3.7 in. and a stroke of 3.4 in. The clearance volume is 16
abruzzese [7]

Answer:

1) The three possible assumptions are

a) All processes are reversible internally

b) Air, which is the working fluid circulates continuously in a closed loop

cycle

c) The process of combustion is depicted as a heat addition process

2) The diagrams are attached

5) The net work per cycle is 845.88 kJ/kg

The power developed in horsepower ≈ 45374 hP

Explanation:

1) The three possible assumptions are

a) All processes are reversible internally

b) Air, which is the working fluid circulates continuously in a closed loop

cycle

c) The process of combustion is depicted as a heat addition process

2) The diagrams are attached

5) The dimension of the cylinder bore diameter = 3.7 in. = 0.09398 m

Stroke length = 3.4 in. = 0.08636 m.

The volume of the cylinder v₁= 0.08636 ×(0.09398²)/4 = 5.99×10⁻⁴ m³

The clearance volume = 16% of cylinder volume = 0.16×5.99×10⁻⁴ m³

The clearance volume, v₂  = 9.59 × 10⁻⁵ m³

p₁ = 14.5 lbf/in.² = 99973.981 Pa

T₁ = 60 F = 288.706 K

\dfrac{T_{2}}{T_{1}} = \left (\dfrac{v_{1}}{v_{2}}  \right )^{K-1}

Otto cycle T-S diagram

T₂ = 288.706*6.25^{0.393} = 592.984 K

The maximum temperature = T₃ = 5200 R = 2888.89 K

\dfrac{T_{3}}{T_{4}} = \left (\dfrac{v_{4}}{v_{3}}  \right )^{K-1}

T₄ = 2888.89 / 6.25^{0.393} = 1406.5 K

Work done, W = c_v×(T₃ - T₂) - c_v×(T₄ - T₁)

0.718×(2888.89  - 592.984) - 0.718×(1406.5 - 288.706) = 845.88 kJ/kg

The power developed in an Otto cycle = W×Cycle per second

= 845.88 × 2400 / 60  = 33,835.377 kW = 45373.99 ≈ 45374 hP.

8 0
3 years ago
Question: 10 of 15
Anvisha [2.4K]

Answer:

Leg length

Explanation:

The distances from the root to the edges of the legs (toes) and the height of the crown are basic measurements.

3 0
3 years ago
The link acts as part of the elevator control for a small airplane. If the attached aluminum tube has an inner diameter of 25 mm
aksik [14]

Answer:

Tmax=14.5MPa

Tmin=10.3MPa

Explanation:

T = 600 * 0.15 = 90N.m

T_max =\frac{T_c}{j}  = \frac{x}{y}  = \frac{90 \times 0.0175}{\frac{\pi}{2} \times (0.0175^4-0.0125^4)}

=14.5MPa

T_{min} =\frac{T_c}{j}  = \frac{x}{y}  = \frac{90 \times 0.0125}{\frac{\pi}{2} \times (0.0175^4-0.0125^4)}

=10.3MPa

7 0
3 years ago
The minimum safe working distance from exposed electrical conductors
SVEN [57.7K]

Answer:

b

Explanation:

4 0
3 years ago
What are some common work contexts for Licensing Examiners and Inspectors? Select four options.
Akimi4 [234]

According to O*NET, the common work contexts for Licensing Examiners and Inspectors include:

  1. Telephone
  2. Face-to-face discussions
  3. Contact with others
  4. Importance of being exact or accurate.

O*NET is an acronym for occupational information network and it refers to a free resource center or online database that is updated from time to time with several occupational definitions, so as to help the following categories of people understand the current work situation in the United States of America:

  • Workforce development professionals
  • Students
  • Human resource (HR) managers
  • Job seekers
  • Business firms

On O*NET, work contexts are typically used to describe the physical and social elements that are common to a particular profession or occupational work. Also, the less common work contexts are listed toward the bottom while common work contexts are listed toward the top.

According to O*NET, the common work contexts for Licensing Examiners and Inspectors include:

1. Telephone

2. Face-to-face discussions

3. Contact with others

4. Importance of being exact or accurate.

Read more on work contexts here: brainly.com/question/22826220

6 0
2 years ago
Read 2 more answers
Other questions:
  • How are isometric drawings and orthographic drawings similar?
    10·1 answer
  • Is it more difficult to pump oil from a well on dry land or a well under water?Why?
    11·1 answer
  • Steam enters an adiabatic turbine at 400◦C, 2 MPa pressure. The turbine has an isentropic efficiency of 0.9. The exit pressure i
    11·1 answer
  • Consider the following signal:
    8·1 answer
  • List a minimum of four reasons why you might be rejected for a job offer.
    10·1 answer
  • Which happens when a wave passes through an opening
    12·2 answers
  • When the Moon is in the position shown, how would the Moon look to an observer on the North Pole?
    11·1 answer
  • Report of invertor to convert 12 volt to 220 volt.
    6·1 answer
  • Workplace bullying can cause_____hazards.
    7·1 answer
  • Help please i will give brainlist
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!