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
Write torsion equation and explain the importance of each components.<br>​
Elanso [62]
The equations are based on the following assumptions

1) The bar is straight and of uniform section
2) The material of the bar is has uniform properties.
3) The only loading is the applied torque which is applied normal to the axis of the bar.
4) The bar is stressed within its elastic limit.

Nomenclature

T = torque (Nm)
l = length of bar (m)
J = Polar moment of inertia.(Circular Sections) ( m^4)
J' = Polar moment of inertia.(Non circluar sections) ( m^4 )
K = Factor replacing J for non-circular sections.( m^4)
r = radial distance of point from center of section (m)
ro = radius of section OD (m)
τ = shear stress (N/m^2)
G Modulus of rigidity (N/m^2)
θ = angle of twist (radians)

4 0
2 years ago
Question 1 A design team completes their high-fidelity prototype of a responsive website. Before they hand off designs to the en
MissTica

A question the design team should answer before handing off the designs is: are the designs a true representation of the intended end user experience?

<h3>What is a website?</h3>

A website can be defined as a collective name that is used to describe series of webpages that are interconnected or linked together with the same domain name.

In Computer technology, the main goal of a high-fidelity prototype is to understand how end users would interact with a website and areas to improve the design.

In conclusion, the design team should answer whether or not the designs are a true representation of the intended end user experience before handing off the designs.

Read more on website here: brainly.com/question/26324021

5 0
1 year ago
A square aluminum plate 5 mm thick and 200 mm on a side is heated while vertically suspended in quiescent air at 40C. (A) Determ
Kamila [148]

brainly.com/question/14000001

4 0
3 years ago
What are the relevance of report writing
nasty-shy [4]

Answer:Report writing consists of the history and facts of a project or of any kind of event. It is useful to record past history and an overall summary of decisions. Report writing helps to solve problems as a path. Writing a report will guide you in a way that will modernize details of the improvements and upcoming plans.

6 0
2 years ago
Help please its due today will mark you brainliest
Tems11 [23]

Answer:

launch- The first stage is ignited at launch and burns through the powered ascent until its propellants are exhausted. The first stage engine is then extinguished, the second stage separates from the first stage, and the second stage engine is ignited. The payload is carried atop the second stage into orbit

powered ascent-The first stage is ignited at launch and burns through the powered ascent until its propellants are exhausted. The first stage engine is then extinguished, the second stage separates from the first stage, and the second stage engine is ignited. The payload is carried atop the second stage into orbit

coasting flight-

When the rocket runs out of fuel, it enters a coasting flight. The vehicle slows down under the action of the weight and drag since there is no longer any thrust present. The rocket eventually reaches some maximum altitude which you can measure using some simple length and angle measurements and trigonometry.

ejection charge-At the end of the delay charge, an ejection charge is ignited which pressurizes the body tube, blows the nose cap off, and deploys the parachute. The rocket then begins a slow descent under parachute to a recovery. The forces at work here are the weight of the vehicle and the drag of the parachute.

slow decent- slow downs (i guess)

recovery-A recovery period is typically characterized by abnormally high levels of growth in real gross domestic product, employment, corporate profits, and other indicators. This is a turning point from contraction to expansion and often results in an increase in consumer confidence

Explanation:

6 0
3 years ago
Other questions:
  • Explain the purpose of the checkpoint mechanism. How often should checkpoints be performed?How does the frequency of checkpoints
    6·1 answer
  • A 2.599 g sample of a new organic material is combusted in a bomb calorimeter. The temperature of the calorimeter and its conten
    13·1 answer
  • WILL MARK BRAINLEST PLEASE HELP
    10·1 answer
  • A tank with a volume of 8 m3 containing 4 m3 of 20% (by volume) NaOH solution is to be purged by adding pure water at a rate of
    8·1 answer
  • Chemical materials that are transported are called..
    8·1 answer
  • I need solution fast plesss​
    9·1 answer
  • A wing generates a lift L when moving through sea-level air with a velocity U. How fast must the wing move through the air at an
    7·1 answer
  • A machine used to shred cardboard boxes for composting has a first cost of $10,000, an AOC of $7000 per year, a 3-year life, and
    14·1 answer
  • 9. An elevator on a construction site is being operated at rated capacity of 6 tons, and is supported by two standard steel cabl
    7·1 answer
  • Does anyone know how to fix this? It's a chromebook and project where I have to try to fix it​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!