Answer:
import java.util.Scanner;
public class DataConstraint {
public static void main(String[] args) {
System.out.print("Enter month, day, year separated by spaces :");
Scanner sc=new Scanner(System.in);
int M,D,Y;
M=sc.nextInt();
D=sc.nextInt();
Y=sc.nextInt();
if(1<=M && M<=12 && 1<=D && D<=31 && Y>=1)
{
if(M==4 || M==6 ||M==9 || M==11){
if(D==31) {
System.out.println("month "+M+" can not have more than 30 days");
System.exit(0);
}
}
else if(M==2)
{
if((Y%400==0) || (Y%4==0 && Y%100!=0)) {
if(D>=30) {
System.out.println("month "+M+" cannot have "+D+" days");
System.exit(0);
}
}
else {
if(D>=29) {
System.out.println(Y+" is not a leap year, "+D+" is invalid");
System.exit(0);
}
}
}
System.out.println(M+" "+D+" "+Y+" is a valid date");
}
else{
if(1>=M || M>=12) System.out.println(M+" is not a valid month");
if(1>=D || D>=31) System.out.println(D+" is not a valid date");
if(Y<1) System.out.println("year can not be negative");
}
}
}
Explanation:
- Use a conditional statement to check the month is between 1 and 12.
- Check that the date is between 1 and 31 and year must be positive value.
- If no. of days are more than 29, then the year cannot be a leap year.
Answer:
Brief History Of Computer. The computer as we know it today had its beginning with a 19th century English mathematics professor name Charles Babbage. ... Other developments continued until in 1946 the first general– purpose digital computer, the Electronic Numerical Integrator and Computer (ENIAC) was built.
Explanation:
Computers and electronics play an enormous role in today's society, impacting everything from communication and medicine to science.
Although computers are typically viewed as a modern invention involving electronics, computing predates the use of electrical devices. The ancient abacus was perhaps the first digital computing device. Analog computing dates back several millennia as primitive computing devices were used as early as the ancient Greeks and Romans, the most known complex of which being the Antikythera mechanism. Later devices such as the castle clock (1206), slide rule (c. 1624) and Babbage's Difference Engine (1822) are other examples of early mechanical analog computers.
The introduction of electric power in the 19th century led to the rise of electrical and hybrid electro-mechanical devices to carry out both digital (Hollerith punch-card machine) and analog (Bush’s differential analyzer) calculation. Telephone switching came to be based on this technology, which led to the development of machines that we would recognize as early computers.
The presentation of the Edison Effect in 1885 provided the theoretical background for electronic devices. Originally in the form of vacuum tubes, electronic components were rapidly integrated into electric devices, revolutionizing radio and later television. It was in computers however, where the full impact of electronics was felt. Analog computers used to calculate ballistics were crucial to the outcome of World War II, and the Colossus and the ENIAC, the two earliest electronic digital computers, were developed during the war.
With the invention of solid-state electronics, the transistor and ultimately the integrated circuit, computers would become much smaller and eventually affordable for the average consumer. Today “computers” are present in nearly every aspect of everyday life, from watches to automobiles.
True or False
1. Phishing is the act of sending multiple emails to multiple users in hope of having
2. Spoofing is the act of obtaining unauthorized access to data from a computer
network.
3. Extortion is the act of using the internet to threaten or damage someone's
reputation to extort money or anything else of value.
4. In late 2014, LimeWire was raided for the second time due to years of pirating
movies, music, games, books and other software.
5. Electronic harassment is also referred to as cyberbullying.
6. Non-delivery of service is the act of devising a scheme wherein a culprit posts an
item or service for sale over the internet, and once the transactions have been done, does not
give the item or service.
7. Encryption is the process of converting raw to data code.
8. In piracy, trackers are used to identify IP addresses currently sharing a pirated
file.
9. Wager Gambling is the act of betting on any sports event over the internet.
10. Most email services today have spam or bulk folder that automatically puts
these suspicious emails to that folder.