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
Aloiza [94]
3 years ago
8

Write a piece of codes that asks the user to enter a month (an integer), a day (another integer), and a two-digit year. The prog

ram should then determine whether the month times the day is equal to 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.
#include
using namespace std;
int main()
{
int day;
int month;
int year;
cout<<"enter year"< cin>>year;
cout<<"enter day"< cin>>day;
cout<<"enter month"< cin>>month;
//programology..
if(month*day==year)
{
cout<<"its magic programology year"< }
else
{
cout<<"its not magic year"< }
}
Computers and Technology
1 answer:
Sliva [168]3 years ago
6 0

Answer:

Follows are the code to this question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

int day,month,year;//defining integer variable

cout<<"please enter last two digit of the year: "; //print message

cin>>year;//input year value

cout<<"enter day: "; //print message

cin>>day;//input day value

cout<<"enter month: ";//print message

cin>>month;//print month message

if(month*day==year)//check magic date condition  

{

cout<<"its magic programology year";//print message

}

else

{

cout<<"its not magic year";//print message

}

return 0;

}

Output:

please enter last two digit of the year: 98

enter day: 14

enter month: 7

its magic programology year

Explanation:

In the given code, three integer variable "day, month, and year" is declared, that uses the input method "cin" to input the value from the user-end.

In the next step, an if block statement is used that check month and day value multiple is equal to year value, if the condition is true it will print "magic programology year" otherwise it will print "not the magic year".

You might be interested in
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
____________________ is like a set of instructions that helps hardware process data into information.
Arte-miy333 [17]

Answer:

Program

Explanation:

Program is like a set of instructions that helps hardware process data into information.

Every hardware needs a program to process data into information.

For example take the example of a data processing software like MS Excel.

You open a spreadsheet and enter some data into your sheet. and then ask the program to do some calculations with this data and give you output results. The spreadsheet software does this processing in the background for you and provides you the results.

Without program a hardware doesn't know what to do with the data. Therefore, a program is like a instruction set that guides the hardware what to do with the data.

Note: The terms software and program are usually used together but there is a difference between software and program

A software is a generalized term and program is more like a specific term.

software can be made up of several different programs which performs many different tasks. On the other hand, a program only carry out a specific task or set of instructions.

3 0
3 years ago
Write a Python function called simulate_observations. It should take no arguments, and it should return an array of 7 numbers. E
Bas_tet [7]

Answer:

import random

def simulate_observations():

   #this generates an array of 7 numbers

   #between 0 and 99 and returns the array

   observations = random.sample(range(0, 100), 7)

   return observations

#here,we call the function created above and print it

test_array = simulate_observations()

print(str(test_array))

6 0
3 years ago
Write a method with the header public static void swapAdjacent(int[] values) that takes a reference to an array of integers valu
andreev551 [17]

Answer:

public static void swapPairs(int[] a){

   int len=a.length;

       if(len%2 ==0){

           for(int i=0; i<len; i=i+2){

               a[i]=a[i+1];

               a[i+1]=a[i];

               int[] b={a[i]+a[i+1]};

           }    

       }

       if(len%2 !=0){

           for(int j=0; j<len; j=j+2){

               a[j]=a[j+1];

               a[j+1]=a[j];

               a[len-1]=a[len-1];

               int[] b={a[j]+a[j+1]+a[len-1]};

           }

       }    

}

public static void printArray(int[] a){

   System.out.println(a);

}

3 0
3 years ago
COULD U ANSWER THIS ???
vladimir1956 [14]

Answer:

B.lightning striking a tree

Explanation:

The crowd dispersing in all directions is not a closed-loop by any means, and students jogging around an oval track as well is not a closed-loop, and also not a cross country run from one point to another. However, the lightning striking a tree is a closed loop that best models a circuit. And as lightning strikes the tree, like a closed circuit, tree catches the fire, or in circuitry words, the current is generated, and tree catches the fire due to it, just like bulb starts glowing.

3 0
3 years ago
Other questions:
  • Janice usually works on a particular workbook that contains all business related data. She decides to keep a backup of all the d
    7·2 answers
  • Howard is leading a project to commission a new information system that will be used by a federal government agency. He is worki
    7·1 answer
  • What are some (free) good animation websites (for PC/Microsoft) for a short informational video about homelessness?
    15·1 answer
  • Which of the following countries have mixed-market economy
    5·1 answer
  • What made it possible to develop personal computers?
    10·2 answers
  • Name:
    11·1 answer
  • How is an interpreter different from a compiler?
    9·2 answers
  • Write an expression that executes the loop while the user enters a number greater than or equal to 0.
    9·1 answer
  • I have a question, but it's not a math question. Can anyone give me 5 unblockers for school computers? If you answer this, you w
    5·2 answers
  • What actions might contribute to recommendations you see online?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!