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
Maksim231197 [3]
3 years ago
10

Design a program that asks the user to enter a month (in numeric form), a day, and a two-digit year. The program should then det

ermine whether the month times the day equals the year. If so, it should display a message saying the date is magic. Otherwise, it should display a message saying the date is not magic.
Computers and Technology
1 answer:
Irina-Kira [14]3 years ago
7 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   int mt, day, yr, magic;

   cout << "Enter a month(numeric form)"<< endl;

   cin >> mt;

   cout << "please enter a day"<<endl;

   cin >> day;

   cout << "please enter a year"<< endl;

   cin >> yr;

   // Input Validation

   if (mt<1 || mt>12){

       cout<<"Invalid Month";

   }

   else if (day<1||day>31){

       cout<<"Invalid Day";

   }

   else if (yr>99||yr<0){

       cout<<"Invalid Year";

   }

   else{

   // Calculates magic

   magic = (mt * day);

   if (magic == yr)

   {

   cout << "it is a magic year"<<endl;;

   }

   else

   cout << "It is not a magic year" << endl;

   }

   return 0;

}

Explanation:

Using C++ we request the user to enter values for Month, day and year (two digits). We carry out input validation to ensure the user enters a valid month, day and year. Using if/elseif/if statements we ensure the conditions given in the question.

You might be interested in
How do you turn on the Track Changes feature in a word-processing document?
aniked [119]
Click options in the tools menu and select track changers
5 0
3 years ago
A newly opened law firm in Kirkland decides to create a small website that provides a brief introduction of the firm, its missio
Ivan

Answer:

Flat web architecture

Explanation: A flat web architecture is a type of web Structure where to link chain exists, in this type of web architecture,users can access the web site with few number of clicks such as in one, two or three clicks with a maximum of four clicks.

One of the basic importance when dealing with web pages is the number of clicks before the page requested can be reached. The lower the number of clicks the better.

5 0
3 years ago
Which tool ia used to create the world wide web?
avanturin [10]

Answer:

HTML

Explanation:

HTML is the correct answer

5 0
3 years ago
PLSSSSS HELPP!! Tropical rainforests are home to many kinds of birds, including parrots, toucans and eagles. Each different spec
Elanso [62]

Answer:

C I believe

Explanation:

5 0
3 years ago
Read 2 more answers
What are the three primary separation of concerns on the client-side of a dynamic web application? (Check all that apply)
nlexa [21]

Answer:

Behaviour

Style

Structure

Explanation:

Above are the three primary separation of concerns for a web application at client side.

Structure --> we can define the structure of the application at client side using HTML

style-->style is used to give some styling information like font,color,headings so on at client side .In general we use CSS to do this at client side

Behaviour--> it actually defines the functionality of the elements at client side like when we click button what it should do.We will use JavaScript to define the behaviours at client side

7 0
3 years ago
Other questions:
  • To name a computed field, follow the computation with the word ____ and then the name you wish to assign to the field
    8·1 answer
  • Maria found a cupcake recipe on a cooking blog. However, she would like to read comments and suggestions before she begins bakin
    6·2 answers
  • Design an algorithm for finding all the factors of a positive integer. For example, in the case of the integer 12, your algorith
    8·1 answer
  • Which of the following is *not* true about logging user and program actions on a computer?
    10·1 answer
  • What is the subnet mask ?
    9·2 answers
  • Which of the following is true of information systems?
    15·1 answer
  • How are IP addresses usually written?
    7·1 answer
  • Select one or more of the following: Which of these events will cause signal(s) to be generated by the kernel (the operating sys
    6·1 answer
  • What is the code i need to do
    12·1 answer
  • You have an application that renders videos for your online business. You want to make sure that the application continues to re
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!