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
Which of the following statements is true regarding input and output?
GarryVolchara [31]

Answer:

Input is the raw data that is entered into the computer for processing.

3 0
2 years ago
Read 2 more answers
Michael has increased the contrast of the given picture. Which feature or menu option of a word processing program did he use?
Kitty [74]
Artistic effects under design?
8 0
2 years ago
Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, pr
Finger [1]

Answer:

public static void PrintShampooInstructions(int numberOfCycles){

       if (numberOfCycles<1){

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

       }

       else if(numberOfCycles>4){

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

       }

       else

           for(int i = 1; i<=numberOfCycles; i++){

               System.out.println(i +": Lather and rinse");

           }

       System.out.println("Done");

   }

Explanation:

I have used Java Programming language to solve this

Use if...elseif and else statement to determine and print "Too Few" or "Too Many".

If within range use a for loop to print the number of times

8 0
2 years ago
Read 2 more answers
Given the following header: vector split(string target, string delimiter); implement the function split so that it returns a vec
suter [353]

Answer:

see explaination

Explanation:

#include <iostream>

#include <string>

#include <vector>

using namespace std;

vector<string> split(string, string);

int main()

{

vector<string> splitedStr;

string data;

string delimiter;

cout << "Enter string to split:" << endl;

getline(cin,data);

cout << "Enter delimiter string:" << endl;

getline(cin,delimiter);

splitedStr = split(data,delimiter);

cout << "\n";

cout << "The substrings are: ";

for(int i = 0; i < splitedStr.size(); i++)

cout << "\"" << splitedStr[i] << "\"" << ",";

cout << endl << endl;

cin >> data;

return 0;

}

vector<string> split(string target, string delimiter)

{

unsigned first = 0;

unsigned last;

vector<string> subStr;

while((last = target.find(delimiter, first)) != string::npos)

{

subStr.push_back(target.substr(first, last-first));

first = last + delimiter.length();

}

subStr.push_back(target.substr(first));

return subStr;

}

4 0
2 years ago
Shira’s Shoes sold 875,000 pairs of sandals in June, which was 70% of the total number of shoes sold. How many shoes did the com
Angelina_Jolie [31]

Explanation:

Emily solved for a part when she should have solved for the whole. 875,000 should be the numerator of the equivalent ratio. 70 x 12,500 is 875,000. So the answer is 100 x 12,500 which is 1,250,000.

8 0
1 year ago
Read 2 more answers
Other questions:
  • Mitchell has noticed that his co-workers are unable to open attachments in the emails he sends. What is one possible reason for
    5·1 answer
  • Access to sensitive or restricted information is controlled describes which of the key communications and information systems pr
    8·1 answer
  • Assume that myCar is an instance of the Car class and that the Car class has a member function named accelerate. Which of the fo
    7·1 answer
  • Which of these statements regarding mobile games is true? A. They are typically played indoors. B. They have detailed environmen
    7·1 answer
  • What is printed by the following program provided all necessary standard header files are included? Explain each line of the out
    10·1 answer
  • Insert the appropriate functions in the Summary Statistics section of the worksheet: cells H18:H22. Format the payments with Acc
    5·1 answer
  • Identifying Characters
    11·2 answers
  • As a digital investigator for your local sheriff’s department, you have been asked to go with a detective to a local school that
    13·1 answer
  • As a security engineer, compare and contrast the pros and cons of deploying hetero vs homogenous networks. Which costs more? Whi
    6·1 answer
  • Write a program that repeatedly reads in integers until a negative integer is read. The program keeps track of the largest integ
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!