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
Drag each tile to the correct box. Shawn has been assigned to create a storyboard for an online grocery website. Organize the st
defon

Answer:  I believe the correct order is:

    Create a box and title it as the “Home Page”  →   Branch out pages and specify navigation flow  →  Gather information such as text and images   →   Determine the title, heading, and content for each page  →   Draw a layout of each web page with its elements.

Explanation:  It makes sense, you start with your "Home Page", then you follow the steps of planning to map out your site's navigation. You have to gather information about it before you have enough knowledge about it to determine the title, heading, and content.  You also need to know the content to create a clean and workable layout for the page.

6 0
3 years ago
Read 2 more answers
Como desbloqueo paginas web en windows 7
dimulka [17.4K]

Answer:

WHAT IN EGLISH PLZ

Explanation:

4 0
3 years ago
Graphics you can select to reinforce the goal of your document include ____.
Tanya [424]
The answer would be D all of the above.
8 0
3 years ago
Chosse
nadya68 [22]

B) facial recognite feature is the right answer

Explanation:

it is because when we click 'people' option it shows the different kind of people who you have taken picture with that is why B is the right answer

3 0
3 years ago
Read 2 more answers
Write a function that receives an integer list from STL and returns the sum of even numbers in the list (return zero if no even
Doss [256]

Answer:

int sumeven(int lis[],int n)

{

   int sum_e=0;//integer variable to store the sum.

   for(int i=0;i<n;i++)

       {

           if(lis[i]%2 == 0)//if the number is even adding to sum_e.

           sum_e=sum_e+i;

       }

   return sum_e;//retuning the sum.

   

}

Explanation:

The above written function is in C++.This function find the sum of even numbers in the list provided.It loops over the array and if the number is even adds to the variable sum_e finally return sum_e which having the sum of even numbers now.

8 0
3 years ago
Other questions:
  • What is blue L.E.D. light
    8·2 answers
  • Write the interface (.h file) of a class Counter containing: A data member counter of type int. A data member named counterID of
    13·1 answer
  • How long does a baby dolphin stay with its mum
    8·1 answer
  • One or more access points positioned on a ceiling, wall, or other strategic spot in a public place to provide maximum wireless c
    9·1 answer
  • What data type stores images and audio visual clips???
    9·1 answer
  • .9 What is Artificial Intelligence?
    5·1 answer
  • Computer can do work very___​
    7·2 answers
  • The Last Free brainliest<br><br> This Is The Last Brainliest That Im Doing Forever Sorry Guys
    8·2 answers
  • Engineers at Edison Laboratories developed a _____ strip that allowed them to capture sequences of images on film.
    14·2 answers
  • a cryptarithm is a mathematical puzzle where the goal is to find the correspondence between letters and digits such that the giv
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!