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
Sergeu [11.5K]
2 years ago
10

Write a class called Date that represents a date consisting of a day, month, and year. A date object should have the following m

ethods: public Date(int day, int month, int year) -- Constructs a new Date object to represent the given date public int getDay() -- returns the day value of this date public int getMonth() -- returns the month value of this date public int getYear() -- returns the year value of this date public void addDays(int days) -- Moves the Date object forward in time by the given number of days public int daysTo(Date other) -- Returns the number of days between this Date and the other Date public boolean isLeapYear() -- Returns true if the year of this Date is a leap year. A leap year occurs when the value of the year is divisible by 4, except when it is divisible by 100 and not 400 (so 1700, 1800, and 1900 are not leap years) public String toString() -- returns a String representation of this date in the form day/month/year Write a program in which to test your class. This program should prompt the user to enter the days, months, and years of two separate dates, and then print out the number of days between these two dates.
Computers and Technology
1 answer:
Inessa [10]2 years ago
7 0

Answer:

No

Explanation:

Because it's years and its also very public

You might be interested in
Given class triangle (in files triangle.h and triangle.cpp), complete main() to read and set the base and height of triangle1 an
kow [346]

The C++ program that would complete the main () and set the base and height of triangle1 and of triangle2 is:

main.cpp

#include <iostream>

#include "Triangle.h"

using namespace std;

int main()

{

   Triangle Tri1;  

Triangle Tri2;

   double base1, height1, base2, height2;

   cout << "Enter a base for your Triangle1: ";

   cin >> base1;

   cout << "Enter a height for your Triangle1: ";

   cin >> height1;

   cout << endl;

   cout << "Enter a base for your Triangle2: ";

   cin >> base2;

   cout << "Enter a height for your Triangle2: ";

   cin >> height2;

   cout << endl;

   

   cout << "################################" << endl;

   

   cout << "Triangle with larger area:" << endl;

   if ((0.5)*base1*height1 > (0.5)*base2*height2){

      Tri1.setValues(base1, height1);

      Tri1.getValues();

      cout << "Area: " << Tri1.getArea() << endl << endl;

}

else{

 Tri2.setValues(base2, height2);

 Tri2.getValues();

    cout << "Area: " << Tri2.getArea() << endl;

}

   

   return 0;

}

Read more about C++ programs here:

brainly.com/question/20339175

#SPJ1

3 0
1 year ago
A program is required to three (3) numbers. calculate and print their total
podryga [215]

A program that is required to three (3) numbers. calculate and print their total is given below:

<h3>The Program</h3>

import java.util.Scanner;

public class SumAndAverage {

public static void main(String[ ] args) {

System.out.println("Enter three numbers - ");

// Accepting and finding sum of numbers.

int sum = 0;

Scanner sc = new Scanner(System.in);

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

sum += sc.nextInt( );

// Printing sum and average.

System.out.println("Sum - " + sum);

System.out.println("Average - " + (sum / 3f));

}

}

The output would request three different numbers, then add them up, and display the output of the sum and then display or print their total


Read more about programming here:

brainly.com/question/23275071

#SPJ1

5 0
1 year ago
A large global retail corporation has experienced a security breach, which includes personal data of employees and customers.
sergeinik [125]

The act that  Accenture would offer as the best solution to ensure enhanced security in the future is Data Protection program.

<h3>What is Accenture  about?</h3>

In Keeping client data protected, Accenture’s Information Security Client is known to be well built up with Data Protection program that can help client teams with a good approach and the security controls, etc.

Therefore, The act that  Accenture would offer as the best solution to ensure enhanced security in the future is Data Protection program.

Learn more about Accenture from

brainly.com/question/25682883

#SPJ1

5 0
2 years ago
Write an if/else statement that assigns 0 to x when y is equal to 10; otherwise it should assign
Liono4ka [1.6K]

Answer:

if(y==10)

{

     x=0;   // assigning 0 to x if y equals 10.

}

else

{

   x=1;   // assigning 1 to x otherwise.

}

Explanation:

In the if statement i have used equal operator == which returns true if value to it's right is equal to value to it's left otherwise false.By using this operator checking value of y and if it is 10 assigning 0 to x and if it is false assigning 1 to x.

7 0
2 years ago
Which of the following is equivalent to (p&gt;=q)? <br> i) P q iv) !p Where are genius people?:)
Elena L [17]

Answer:

Explanation:

This is unsolvable if you have no variable substitutes

4 0
2 years ago
Other questions:
  • What are the six critical components of an information system? Select three of the six components, and describe a potential vuln
    15·1 answer
  • 6. A distribution consists of three components with frequencies 200, 250 and 300 having means
    14·1 answer
  • What are the ASE special certifications?
    14·2 answers
  • What are the four stages a customer goes through when buying a product?
    7·2 answers
  • ________ are chunks of software - installed on one's computer, tablet, or smartphone - that are gateways to games, online resour
    8·1 answer
  • You are in the windows power shell window and decide to encrypt folder which of the following command do you use
    7·1 answer
  • The name of a .java file should ______________________________. Always match the name of the Class inside Should always start wi
    9·1 answer
  • Direction: Write True on the line if the statement is correct. Write False if the statement is incorrect. 1. All objects are com
    13·2 answers
  • True or False? The background color block should be inserted after all the images are added.
    7·1 answer
  • Which example best demonstrates an impact of computers on the economy?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!