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
nydimaria [60]
3 years ago
7

Given the following class import java.util.ArrayList; public class RectangleTester { public static void main(String[ ] args) { A

rrayList shapes = new ArrayList(); shapes.add(new Rectangle(1, 1)); shapes.add(new Rectangle(2, 2)); shapes.add(new Rectangle(3, 3)); shapes.add(new Rectangle(4, 4)); Rectangle dataRecord; for(int index = 0; index < shapes.size(); index++) { dataRecord = shapes.get(index); dataRecord.calcRectArea(); dataRecord.calcRectPerimeter(); } } } Which of the following could not be a constructor for the RectangleClass? I. Rectangle(int s1, int s2) { mySide1 = s1; mySide2 = s2; } II. Rectangle(s1, s2) { mySide1 = s1; mySide2 = s2; } III. Rectangle() { }
Computers and Technology
1 answer:
horrorfan [7]3 years ago
8 0
We didn't need to see all that code to know that answer.


I. Rectangle(int s1, int s2) { }
is a valid constructor

I<span>I. Rectangle(s1, s2) { }
is an invalid constructor, as the data type for s1 and s2 was not specified.

</span>II<span>I. Rectangle() { }
is a valid constructor, as it is simply the default constructor.</span>
You might be interested in
Write a program to input a number and check whether it is even or odd number
Mashutka [201]

Answer:#include <stdio.h>

int main() {

   int num;

   printf("Enter an integer: ");

   scanf("%d", &num);

   // true if num is perfectly divisible by 2

   if(num % 2 == 0)

       printf("%d is even.", num);

   else

       printf("%d is odd.", num);

   

   return 0;

}

3 0
2 years ago
Traceability of requirements is helpful in the followingexcept
larisa86 [58]

Answer: D)  Identifying GUI's for a particular requirement

Explanation:

 Traceability of requirements is helpful except identifying GUI's for a particular requirements as, traceability in project management describe the relationships between two or more element throughout in the development process and outline the relationship between the customer requirement by traceability matrix. And the requirement of traceability is so important because it creating a downstream flow of software and test cases in software requirement but not helpful in GUI identification.

6 0
3 years ago
Write the definition of a method printDottedLine, which has no parameters and doesn't return anything. The method prints to stan
Bond [772]

Answer:

public static void printDottedLine()

{

  System.out.println(".....");

}

Explanation:

The above written code is in JAVA and it is the method definition of the method mentioned in the question.Since the method returns nothing hence it's return type is void and it does not have any arguments hence there is nothing written in the parenthesis.In JAVA System.out.println is used for standard output and trminates them by newline.

3 0
3 years ago
4) To run program short cut​
quester [9]

Answer:

Run Dialog

Open it by pressing WinKey+R. In the Run dialog, type the name of a program's .exe file and press Enter to launch it.

Explanation:

Please give me brainlist and follow

6 0
3 years ago
Write a program to input the TotalCost and display the Assured gift as per the following criteria TotalCost(TC) Assured Gift Les
Yanka [14]

Answer:

The program in Python is as follows:

TotalCost = int(input("Total cost: "))

if TotalCost <= 2000:

   print("Wall Clock")

elif TotalCost >= 2001 and TotalCost <= 5000:

   print("School Bag")

elif TotalCost >= 5001 and TotalCost <= 10000:

   print("Electric Iron")

else:

   print("Wrist Watch")

Explanation:

This gets input for total cost

TotalCost = int(input("Total cost: "))

If the total cost is up to 2000, print wall clock as the assured gift

<em>if TotalCost <= 2000:</em>

<em>    print("Wall Clock")</em>

If the total cost is between 2001 and 5000 (inclusive), print school bag as the assured gift

<em>elif TotalCost >= 2001 and TotalCost <= 5000:</em>

<em>    print("School Bag")</em>

If the total cost is between 5001 and 10000 (inclusive), print electric iron as the assured gift

<em>elif TotalCost >= 5001 and TotalCost <= 10000:</em>

<em>    print("Electric Iron")</em>

If the total cost is more than 10000, print wrist watch as the assured gift

else:

   print("Wrist Watch")

8 0
3 years ago
Other questions:
  • The a0 is the part of the central processing unit that performs arithmetic calculations for the computer.
    8·1 answer
  • Pls help! ive been looking everywhere online but I couldn't find the answer to this:
    5·1 answer
  • What type of printer heats toner to adhere it to the paper? inkjet . impact. 3D. laser.
    6·1 answer
  • You make an online purchase of a hooded sweatshirt with the logo of the Dallas Cowboys. The next time you log on, your screen ha
    9·1 answer
  • Are you allowed to copy and paste answers on brainy to give answers to other people?
    5·2 answers
  • 7.
    15·1 answer
  • Write a program that uses an initializer list to store the following set of numbers in an array named nums. Then, print the arra
    10·2 answers
  • Both employers and employees have responsibilities and ___________.
    10·2 answers
  • Is anyone else having issues with brainly not working? Everytime I click on a answer it only comes up with the 7 month trail thi
    12·1 answer
  • CreatePolicies<br> I need help with this in java.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!