answer.
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
Sergio [31]
2 years ago
12

Define a new object in variable sculptor that has properties "name" storing "Michelangelo"; "artworks" storing "David", "Moses"

and "Bacchus"; "bornDate" storing "March 6, 1475"; and "diedDate" storing "February 18, 1564".
Computers and Technology
1 answer:
Talja [164]2 years ago
6 0

Answer:

       String [] artworks = {"David","Moses","Bacchus"};

       Sculptor sculptor = new Sculptor("Michaelangelo",artworks,

               "March 6, 1475","February 18, 1564");

Explanation:

  • To solve this problem effectively;
  • Create a class (Java is used in this case) with fields for name, artworks(an array of string), bornDate and diedDate.
  • Create a constructor to initialize this fields
  • In a seperate class SculptorTest, within the main method create an array of String artworks and initialize to {"David","Moses","Bacchus"};
  • Create a new object of the class with the line of code given in the answer section.
  • See code for complete class definition below:

<em>public class Sculptor {</em>

<em>    private String name;</em>

<em>    private String [] artworks;</em>

<em>    private String bornDate;</em>

<em>    private String diedDate;</em>

<em>    public Sculptor(String name, String[] artworks, String bornDate, String diedDate) {</em>

<em>        this.name = name;</em>

<em>        this.artworks = artworks;</em>

<em>        this.bornDate = bornDate;</em>

<em>        this.diedDate = diedDate;</em>

<em>    }</em>

<em>}</em>

<em>//Test Class with a main method</em>

<em>class SculptorTest{</em>

<em>    public static void main(String[] args) {</em>

<em>        String [] artworks = {"David","Moses","Bacchus"};</em>

<em>        Sculptor sculptor = new Sculptor("Michaelangelo",artworks,</em>

<em>                "March 6, 1475","February 18, 1564");</em>

<em>    }</em>

<em>}</em>

You might be interested in
A semaphore puts a thread to sleep:
otez555 [7]

Answer:

B. until another thread issues a notify on the semaphore.

Explanation:

A semaphore is a variable that is shared between threads and is not negative. It also acts as a calling mechanism that uses two atomic operations wait and signal for synchronization of processes.

A thread that is waiting for a process can be signaled by another thread.

A semaphore puts a thread to sleep until another thread issues a notify on the semaphore.

The wait operation will get a semaphore or otherwise wait if the busy S semaphore is available.

The signal operation will release a semaphore or wake a process if there is a thread waiting for S.

3 0
2 years ago
Which of the following provides a suite of integrated software modules for finance and accounting, human resources, manufacturin
zzz [600]

Answer:

B) ERP systems

Explanation:

ERP which means Enterprise Resource Planning is a software that uses a centralized database, it helps to hasten business processes thereby reducing the use of manual labour. Some of the integrated software modules which it provides are:

*Finance, Accounting.

*Human resource.

*Manufacturing and production.

*Sales and marketing.

The ERP system does not really need the total involvement of a human because it has a database where information stored is used in the daily execution of tasks, it can also be used to measure the productivity and profitability of the business.

6 0
2 years ago
Write a algorithm to attend birthday party​
kolezko [41]

Answer:

2     No

5 14    Yes

Explanation:

8 0
2 years ago
Read 2 more answers
Using the college registration example from section 6.7.3 as a starting point, do the following:
Arada [10]

Answer:

Explanation:

NCLUDE Irvine32.inc

TRUE = 1

FALSE = 0

.data

gradeAverage WORD ?

credits WORD ?

oKToRegister BYTE ?

str1 BYTE "Error: Credits must be between 1 and 30" , 0dh,0ah,0

main PROC

call CheckRegs

exit

main ENDP

CheckRegs PROC

push edx

mov OkToRegister,FALSE

; Check credits for valid range 1-30

cmp credits,1 ; credits < 1?

jb E1

cmp credits,30 ; credits > 30?

ja E1

jmp L1 ; credits are ok

; Display error message: credits out of range

E1:

mov edx,OFFSET str1

call WriteString

jmp L4

L1:

cmp gradeAverage,350 ; if gradeAverage > 350

jna L2

mov OkToRegister,TRUE ; OkToRegister = TRUE

jmp L4

L2:

cmp gradeAverage,250 ; elseif gradeAverage > 250

jna L3

cmp credits,16 ; && credits <= 16

jnbe L3

mov OkToRegister,TRUE ; OKToRegister = TRUE

jmp L4

L3:

cmp credits,12 ; elseif credits <= 12

ja L4

mov OkToRegister,TRUE ; OKToRegister = TRUE

L4:

pop edx ; endif

ret

CheckRegs ENDP

END main

8 0
2 years ago
given:an int variable k,an int array currentMembers that has been declared and initialized,an int variable memberID that has bee
Oksi-84 [34.3K]

Answer:

// The code segment is written in C++ programming language

// The code segment goes as follows

for (k = 0; k < nMembers; k++)

{

//check if memberID can be found in currentMembers

if (currentMembers[k] == memberID){

// If yes,

// assigns true to isAMember

isAMember = true;

k = nMembers;

}

else{

isAMember = false;

// If no

// assigns false to isAMember

}

}

// End of segment:

The following assumption were made in the code segment above.

There exists

1. An already declared and initialised int array currentMembers.

2. An already initialised int variable memberID

Line 3 initiates a loop to scan through the array

Line 6 checks for the condition below

If current element of array equals memberID then

It assigns true to isAMember and nMembers to k

Else

It assigns false to isAMember

7 0
2 years ago
Other questions:
  • Which are examples of copyrighted online materials? Check all that apply.
    14·2 answers
  • "the ____ criteria filter requires the records displayed to have the specified text string anywhere."
    11·1 answer
  • Grabar microphone audio icon_person click each item to hear a list of vocabulary words from the lesson. then, record yourself sa
    7·2 answers
  • The development of the original personal computer (PC) was a(n) __________ innovation at the time, whereas adding a different ki
    8·1 answer
  • Consider the following classes:
    8·1 answer
  • Enter a nested function in cell G8 that displays the word Flag if the Payment Type is Credit and the Amount is greater than or e
    9·1 answer
  • You are using a polynomial time 2-approximation algorithm to find a tour t for the metric traveling salesman problem. Which of t
    7·1 answer
  • In this assignment, you are provided with working code that does the following: 1. You input a sentence (containing no more than
    14·1 answer
  • In C++ the declaration of floating point variables starts with the type name double, followed by the name of the variable, and t
    10·1 answer
  • Summary: Given integer values for red, green, and blue, subtract the gray from each value. Computers represent color by combinin
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!