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
Given a program with execution times broken down shown below. Assume that techniques can only be applied to accelerate the integ
Alex17521 [72]

<u>Solution and Explanation:</u>

Floating point and Integer consumes 1000 seconds of 1600 seconds.

Since we shall be talking of theoretical speed-up, please do not try to relate this with any practical scenario :P

To achieve maximum speed up, we need to reduce the time consumed by FP and Integer as large as possible. So we consider a system that does not at all consume time to perform FP and Integer operations. With such specifications, we can say that our new system will consume 600 seconds.

 speed up = 1600 divide by 600 = 2.66

<u>part b: </u>

We need a System with enhancement that will result in speedup of 2.

So the time required for the new system would be 800 sec

 Required time = 1600 divide by = 800 seconds

It is now given that Floating Point can now be accelerated by 5 times, so our enhanced system will consume 40 seconds to perform Floating point operations

We know that Load/Store and branch operations cannot be enhanced and hence they will consume 600 seconds.

Therefore to attend speedup of 2, Integer operations must be completed in 160 seconds (160 = 800 – (600 + 40))

So speed up required for Integer Operations is 800/160 = 5

So Integer Operation should need 5 times less time to achieve speed up of 2

7 0
3 years ago
For a 20 ohm resistor R, the current i = 2 A. What is the voltage V? Submit your answer as a number without units. ​
svetoff [14.1K]

Answer:

20*2=40

Explanation:

7 0
3 years ago
Are engineers needed in today’s society ? Why or why not ? I need a short three paragraph essay !!! Please help me !!!
masha68 [24]
Of course they are needed because without them the society wouldn’t be as nice as it is right now and plus there would be no more buildings ! :)
8 0
3 years ago
Your manager has asked you to research and recommend a writing guide that examiners in your digital forensics company can use fo
vivado [14]

Answer:

Kindly Check the explanation

Explanation:

Report

A Report is a way to present the forensic examination result in front of judge. A report contains warrants, all affidavits issued for arrest, expenses occur during forensic test and lists of evidence. Apart from evidence a report also contains expert opinions.  

Guidelines  

These are the set of rules and written statement which are used to present the important information in a structured and clear format. The main motive behind to define the guidelines is to achieve standardization in the reports. It also improves the readability of the report.  

Guidelines for report  

Abstract:  

Each report must contain an abstract of the report which gives the brief review about the report. It came at the starting of the report. The main motive behind to give abstract is to give brief about report to someone in a very less time. The size of abstract must not be more than one page.  

Index:  

Each report must contain an index which display's which content is available at which page of report. The content of index must be appropriate and clear so that the reader will not get confuse.

Format of report:

The formatting of report is also one of the essential parts of the guidelines. It makes the report attractive and also due to this reader not gets bored while reading the report. The guidelines regarding layout of report are as follow:  

1. Use time roman font and 12 font size as a default font to explain anything in the report.  

2. The explanation must be justified

3. As possible divide the long paragraph. if possible explain in points.

4. The page must have border on all sides

5. Each pages must have numbering and footer

Rules for grammar:

1. The language of the report must be simple and clear. So that everyone can understand it easily.

2. Avoid repeating same sentence or word again and again.

3. Use active instead of passive voice, in order to give importance to doer.

4. Write expressions between commas.

5. Avoid spelling mistakes in report which also make wrong impact.

6. As possible give heading or subheading to material or explanation which must be accurate.

7. Explain, new or difficult words used in the report.

8. What ever written in the report must be through the point and accurate on bases of fact.

Body of report:

The body of the report referred to as a content written inside the report. In order to write an impressive report, it must include all these things:

1. Avoid use of hypothetical question, if still hypothetical question arises it must be bases on factual evidence.  

2. Add all the affidavits and warrants in the report issued for search and arrest.

3. The cost money expenses while solving the case.

4. The expert opinion which must be bases on knowledge or previously declare case results.

5. The list of people and evidence which are collected and interrogative during the investigation.

6. If investigation is further going on than write the area in which the investigation further goes on and also mention when the investigation get complete.  

Forensic software used:  

A short must be given about the software used in the investigation. The result generated by the software must also be pasted in that report. It is more good if attach the snap shot of the result. Add any previous case result in which the same software result is taken as evidence, in order to justify that the result generated by the software is true. Some of forensic softwares are FTK, ProDiscover, Hexworkshop. The result of these softwares must be heighted so that everyone can notice it.  

Conclusion:  

The conclusion must be given at the end of report to tell according him what result came after investigation. In conclusion also write on which basis the result concludes. There must be strong behind the conclusion.  

References:  

In Reference write all the cases, thesis, books which an investigator followed to solve the current case. In addition if they referred any internet article. They can also write the website name where  that article lies. In short can say that write everything where they got an idea which is helpful in solving the case.

 

8 0
3 years ago
What are the 5 major forest types?
Nataly [62]

Answer:

1. Equatorial Evergreen or Rainforest

2. Tropical forest

3. Mediterranean forest

4. Temperate broad-leaved forest

5. Warm temperate forest

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • What is an ip<br> Number
    12·1 answer
  • A simple ideal Rankine cycle with water as the working fluid operates between the pressure limits of 4 MPa in the boiler and 25
    14·2 answers
  • A large truck drives down the highway at 10 m/s hauling a rectangular trailer that is 6 m long, 2 m wide, and 2 m tall. The trai
    14·1 answer
  • A composite wall is made of two layers of 0.3 m and 0.15 m thickness with surfaces held at 600°C and 20°C respectively. If the c
    9·1 answer
  • Considering the two tables below called Orders and OrderLines, how many rows would be returned by this SQL query? SELECT o.Order
    10·1 answer
  • You are analyzing an open-return wind tunnel that intakes air at 20 m/s and 320K. When the flow exits the wind tunnel it is movi
    14·2 answers
  • Convert 103.69 kN to TN.
    14·1 answer
  • Fluid systems can distribute pressure unequally to all points in a system.<br><br> True<br> False
    15·1 answer
  • An ocean thermal energy conversion system is being proposed for electric power generation. Such a system is based on the standar
    5·1 answer
  • Cual es la definición de la distribución de las instalaciones?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!