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
When a customer makes an online hotel booking the database is updated by using
Valentin [98]
I think it’s a form,if wrong please don’t be mad
4 0
3 years ago
Read 2 more answers
16.50. Suppose we have a sequential (ordered) file of 100,000 records where each record is 240 bytes. Assume that B = 2,400 byte
Nat2105 [25]

Answer and Explanation:

Given that total number of records in a file = 100000

Each record consists of= 240 bytes

Given that B= 2400 bytes.

Then total blocks in file = 100000 records * 240 / 2400

= 10000 blocks.

Time that will take for exhaustive read

= s + r + b.btt

= 16 + 8.3 + (10000) * 0.8

= 8024.3 msec

Now as per given X be the number of records that are searched randomly and it takes more than exhaustive read time.

Hence, X (s + r + btt) > 8024.3

X (16+8.3+0.8) > 8024.3

X > 8024.3/25.1

So that, X > 319.69

Hence, atleast 320 random reads should be made to search the file

8 0
3 years ago
You decide to bulk upload your multiple business locations to Google My Business. Some of the locations in your upload were disa
koban [17]

Complete Question: You decide to bulk upload your multiple business locations to Google My Business. Some of the locations in your upload were disapproved. Which two errors can cause this issue? (Choose two.)

A    Missing listing photos

B  Late listing registration

C   Multiple locations in one physical address

D  Too many listing users

E  Incorrect business name

Answer:

C) Multiple locations in one physical address

E) Incorrect business name

Explanation:

Google provides a service called Google My Business which allows users  with the aid of special tools create, update and maintain their business profiles on the internet. In this way, users are able to build free simple websites and publish posts to engage their customers more effectively.

In the process of signing up for this service, new users are required to verify their business names and physical locations, In the given question a user trying to upload multiple business locations will not get approval if he uploads Multiple locations in one physical address or enters an Incorrect business name.

4 0
3 years ago
Pat is listing the parts of a computer. Which is the best option to use when formatting the list?
Zina [86]
If you mean a web page ten the bet option would be elements, where gives you an unordered list and give you an order list
5 0
3 years ago
Changing how information is represented so that it can be read by a person is called
Usimov [2.4K]

Answer:

Decode. To change how information is represented so that it can be read by a person.

Explanation:

Decoding is the ability to apply your knowledge of letter-sound relationships, including knowledge of letter patterns, to correctly pronounce written words. Understanding these relationships gives children the ability to recognize familiar words quickly and to figure out words they haven't seen before.

4 0
2 years ago
Other questions:
  • What are the three fundamental elements of an effective security program for information systems?
    11·2 answers
  • Which of the following best explains why some people invest their saving in the stock market and others put their saving in bank
    5·2 answers
  • in what way do rules and laws created to address public problems affect individuals groups and business
    13·1 answer
  • The part of the computer that contains the brain, or central processing unit, is also known as the A. monitor. B. keyboard. C. m
    13·2 answers
  • The methods of the Character class that begin with ____ return a character that has been converted to the stated format.
    5·1 answer
  • Select the correct answer.
    10·2 answers
  • A mysql prompt has been opened for you. Using the college database, complete the following tasks (use either a single-line or a
    7·1 answer
  • A major public university graduates approximately 10,000 students per year, and its development office has decided to build a We
    10·1 answer
  • Write a Java program that will be able to generate the sample table below.
    5·1 answer
  • You use lpstat and determine that a user named User1 has placed two large print jobs in the queue for Printer1 that have yet to
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!