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
podryga [215]
2 years ago
12

(Java) Which of the following code segments correctly declare a Strings and gives it a value of "fortran".

Computers and Technology
1 answer:
Dovator [93]2 years ago
8 0

Answer:

IT F

Explanation:

You might be interested in
Write a copy assignment operator for CarCounter that assigns objToCopy.carCount to the new objects's carCount, then returns *thi
ollegr [7]

Answer:

Here is the copy assignment operator for CarCounter:

CarCounter& CarCounter::operator=(const CarCounter& objToCopy) {

carCount = objToCopy.carCount;

return *this;  }

The syntax for copy assignment operator is:

ClassName& ClassName :: operator= ( ClassName& object_name)

In the above chunk of code class name Is CarCounter and object name is objToCopy.

Assignment operator = is called which assigns objToCopy.carCount to the new objects's carCount.

This operator basically is called when an object which is already initialized is assigned a new value from another current object.

Then return *this returns the reference to the calling object

Explanation:

The complete program is:

#include <iostream>  //to use input output functions

using namespace std;   //to access objects like cin cout

class CarCounter {  //class name

public:  // public member functions of class CarCounter

CarCounter();  //constructor of CarCounter

CarCounter& operator=(const CarCounter& objToCopy);  //copy assignment operator for CarCounter

void SetCarCount(const int setVal) {  //mutator method to set the car count value

carCount = setVal;  } //set carCount so setVal

int GetCarCount() const {  //accessor method to get carCount

return carCount;  }  

private:  //private data member of class

int carCount;  };    // private data field of CarCounter

CarCounter::CarCounter() {  //constructor

carCount = 0;  //intializes the value of carCount in constructor

return; }  

// FIXME write copy assignment operator  

CarCounter& CarCounter::operator=(const CarCounter& objToCopy){

/* copy assignment operator for CarCounter that assigns objToCopy.carCount to the new objects's carCount, then returns *this */

carCount = objToCopy.carCount;

return *this;}  

int main() {  //start of main() function

CarCounter frontParkingLot;  // creates CarCounter object

CarCounter backParkingLot;   // creates CarCounter object

frontParkingLot.SetCarCount(12);  // calls SetCarCount method using object frontParkingLot to set the value of carCount to 12

backParkingLot = frontParkingLot;  //assigns value of frontParkingLot to backParkingLot

cout << "Cars counted: " << backParkingLot.GetCarCount();  //calls accessor GetCarCount method to get the value of carCount and display it in output

return 0;  }

The output of this program is:

Cars counted = 12

3 0
2 years ago
A major clothing retailer has requested help enhancing their online customer experience. How can Accenture apply Artificial Inte
Harrizon [31]

Answer:

Option D

Explanation:

Artificial intelligence is a technology where the information gathered in the past is processed for the future actions.

Here, based on the preferences of customer in the past and purchase history, AI can suggest the customer new products and services

Hence, option D is correct

3 0
2 years ago
Consider the following sequence of instructions:
omeli [17]

Answer:

i think the answer is c hope this helps!!!!!

Explanation:

8 0
2 years ago
Read 2 more answers
The most common data link layer protocol for wired connections is _____.
harkovskaia [24]

The answer is Ethernet

Ethernet is by far the most popular LAN by a mile. It is a group of protocols that work at either the Data link layer or the Physical layer of the OSI model. Ethernet in the engineering world is defined as the IEEE 802.3 specification.






7 0
2 years ago
To erase an entire entry in a cell and then reenter the data from the beginning, press the ____ key. alt esc ctrl tab
Daniel [21]
To erase an entry in a cell and then reenter the data from the beginning press the esc key. Hope that helps!
8 0
2 years ago
Other questions:
  • Janice is unsure about her future career path she has grown up on her family farm but she is also interested in medicine Janice
    5·1 answer
  • What was one important academic skill the blogger learned?
    9·1 answer
  • Write the definition of a function printLarger, which has two int parameters and returns nothing. The function prints the larger
    15·1 answer
  • A user requests an unencrypted webpage from a web server running on a computer, listening on the Internet Protocol address 10.1.
    14·1 answer
  • Which of the following is a collection of unprocessed items, which can include text, numbers, images, audio, and video?A. DataB.
    14·1 answer
  • Write a program that first reads in the name of an input file, followed by two strings representing the lower and upper bounds o
    15·2 answers
  • Convert to octal. Convert to hexadecimal. Then convert both of your answers todecimal, and verify that they are the same.(a) 111
    12·1 answer
  • php Exercise 3: Function Write a function named word_count that accepts a string as its parameter and returns the number of word
    5·1 answer
  • Explain working principle of computer?​
    13·1 answer
  • What are the two atomic operations permissible on semaphores?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!