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 circular ceramic plate that can be modeled as a blackbody is being heated by an electrical heater. The plate is 30 cm in diame
denis23 [38]

Answer:

Q = 125.538 W

Explanation:

Given data:

D = 30 cm

Temperature T_\infity = 15 degree celcius

T_S =  220 + 273 = 473 K

Heat coefficient = 12 W/m^2 K

Efficiency 80% = 0.8

Q = hA(T_S - T_{\infty}) \eta

= 12(\frac{\pi}{4} 0.3^2) (473 - 288) 0.8

Q = 125.538 W

5 0
3 years ago
It is illegal to improperly dispose of antifreeze.<br> True<br> False
Reil [10]
Ehheem✔️

Explanation:
✔️✖️✔️✖️✔️✖️
6 0
3 years ago
Read 2 more answers
A four-cylinder, four-stroke internal combustion engine operates at 2800 RPM. The processes within each cylinder are modeled as
Ulleksa [173]

Answer:

1) 287760.4 Hp

2) 18410899.5 kPa

Explanation:

The parameters given are;

p₁ = 14.7 lbf/in² = 101325.9 Pa

v₁ = 0.0196 ft³ = 0.00055501 m³

T₁ = 80°F = 299.8167 K

k = 1.4

Assumptions;

1) Air standard conditions are appropriate

2) There are negligible potential and kinetic energy changes

3) The air behaves as an ideal gas and has constant specific heat capacities of temperature and pressure

1) Process 1 to 2

Isentropic compression

T₂/T₁ = (v₁/v₂)^(1.4 - 1) = 10^0.4

p₂/p₁ = (v₁/v₂)^(1.4)

p₂ = p₁×10^0.4 =  101325.9*10^0.4 = 254519.153 Pa

T₂ = 299.8167*10^0.4 = 753.106 K

p₃ = 1080 lbf/in² = 7,446,338 Pa

Stage 2 to 3 is a constant volume process

p₃/T₃ = p₂/T₂

7,446,338/T₃ =   254519.153/753.106

T₃ = 7,446,338/(254519.153/753.106) = 22033.24 K

T₃/T₄ = (v₁/v₂)^(1.4 - 1) = 10^0.4

T₄ = 22033.24/(10^0.4) = 8771.59 K

The heat supplied, Q₁ = cv(T₃ - T₂) = 0.718*(22033.24 -753.106) = 15279.14 kJ

The heat rejected = cv(T₄ - T₁) = 0.718*(8771.59 - 299.8167) = 6082.73 kJ

W(net) = The heat supplied - The heat rejected = (15279.14 - 6082.73) = 9196.41 kJ

The power = W(net) × RPM/2*1/60 = 9196.41 * 2800/2*1/60 = 214582.9 kW

The power by the engine = 214582.9 kW = 287760.4 Hp

2) The mean effective pressure, MEP  = W(net)/(v₁ - v₂)

v₁ = 0.00055501 m³

v₁/v₂ = 10

v₂ = v₁/10 = 0.00055501/10 = 0.000055501

MEP  = 9196.41/(0.00055501 -  0.000055501) = 18410899.5 kPa

4 0
3 years ago
About what thickness of aluminum is needed to stop a beam of (a) 2.5-MeV electrons, (b) 2.5-MeV protons, and (c) 10-MeV alpha pa
Nana76 [90]

The thickness of aluminium needed to stop the beam electrons, protons and alpha particles at the given dfferent kinetic energies is 1.5 x 10⁻¹⁴ m.

<h3>Thickness of the aluminum</h3>

The thickness of the aluminum can be determined using from distance of closest approach of the particle.

K.E = \frac{2KZe^2}{r}

where;

  • Z is the atomic number of aluminium  = 13
  • e is charge
  • r is distance of closest approach = thickness of aluminium
  • k is Coulomb's constant = 9 x 10⁹ Nm²/C²
<h3>For 2.5 MeV electrons</h3>

r = \frac{2KZe^2}{K.E} \\\\r = \frac{2 \times 9\times 10^9 \times 13\times (1.6\times 10^{-19})^2}{2.5 \times 10^6 \times 1.6 \times 10^{-19}} \\\\r = 1.5 \times 10^{-14} \ m

<h3>For 2.5 MeV protons</h3>

Since the magnitude of charge of electron and proton is the same, at equal kinetic energy, the thickness will be same. r = 1.5 x 10⁻¹⁴ m.

<h3>For 10 MeV alpha-particles</h3>

Charge of alpah particle = 2e

r = \frac{2KZe^2}{K.E} \\\\r = \frac{2 \times 9\times 10^9 \times 13\times (2 \times 1.6\times 10^{-19})^2}{10 \times 10^6 \times 1.6 \times 10^{-19}} \\\\r = 1.5 \times 10^{-14} \ m

Thus, the thickness of aluminium needed to stop the beam electrons, protons and alpha particles at the given dfferent kinetic energies is 1.5 x 10⁻¹⁴ m.

Learn more about closest distance of approach here: brainly.com/question/6426420

7 0
2 years ago
QUESTÃO 13. Explique o uso das aspas no trecho "Darei a cada uma de vocês
lesya [120]

Answer: speaks Portuguese

Eu disse a todos a tradução para que possam te ajudar

Explanation: Y’all can help I have no idea

QUESTION 13. Explain the use of quotation marks in the excerpt "I will give each of you

seed. The one who will bring me the most beautiful flower within six months will be chosen but

wife and the future empress of China. ".

QUESTION 14. The palace servant considered the idea of ​​her daughter attending the celeb

organized by the prince of the region, a foolish idea, a madness. This is an OP

Do you agree with this opinion of the character? Justify your answer.

6 0
3 years ago
Other questions:
  • What are 3 reasons why small businesses are an important part of the American economy?
    9·2 answers
  • The water level in a large tank is maintained at height H above the surrounding level terrain. A rounded nozzle placed in the si
    9·1 answer
  • Hii I need help can someone help me
    15·1 answer
  • The formula for the cross sectional area of specimen at the middle is
    5·1 answer
  • Draw a sketch of the following situations identifying the system or control volume, and the boundary of the system or the contro
    10·1 answer
  • For the floor plan shown, if a = sm b= 8m, specify type of Load on Beam AHS<br> D<br> B В
    10·1 answer
  • How do you explain the application of regulations in locations containing baths, showers and electric floor heating, including t
    10·1 answer
  • AA
    10·1 answer
  • Why is personal development necessary based activity success life and career​
    11·1 answer
  • What is the physical mechanism that causes the friction factor to be higher in turbulent flow?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!