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
Damm [24]
3 years ago
14

To enforce the concept of separating class definition from its function implementations, where should the function implementatio

ns of a class be placed?
A. In a .h file.
B. In a.cpp file.
C. In the same file as the main() function.
D. In a .c file.
Computers and Technology
1 answer:
zzz [600]3 years ago
4 0
D(in a .c file ) because that is where it should be placed :)
You might be interested in
What is a drone satellite?​
babymother [125]

Answer:

A satellite that can be controlled where to go.

Explanation:

4 0
3 years ago
In this lab you will write a C program to sort an array of strings. The program will: Create an array of 50 strings; each string
andrezito [222]

Answer:

See explaination

Explanation:

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

void swap(char *arr[], int i, int minIdx)

{

char temp[30];

strcpy(temp, arr[i]);

strcpy(arr[i], arr[minIdx]);

strcpy(arr[minIdx], temp);

}

void sort(char *arr[], int n)

{

for (int i = 0; i < n - 1; i++)

{

int minIdx = i;

int minV = 10000;

char min[30];

strcpy(min, arr[i]);

for (int j = i + 1; j < n; j++)

{

int a = strcmp(min, arr[j]);

if (a < 0)

{

strcpy(min, arr[i]);

minIdx = j;

}

}

swap(arr, i, minIdx);

}

}

void print(char *arr[], int n)

{

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

printf("%s", arr[i]);

}

void read(char *arr[], int *n)

{

FILE *file = fopen("strings.dat", "r");

char line[30];

*n = 0;

printf("Reading from file...\n");

while (fgets(line, 30, file))

{

strcpy(arr[(*n)++], line);

}

print(arr, *n);

}

int main(int argc, char const *argv[])

{

char *arr[50];

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

arr[i] = (char *)malloc(sizeof(char) * 30);

int len;

int n = 0;

read(arr, &n);

printf("\n-------------------------\nAfter sorting\n");

sort(arr, n);

print(arr, n);

}

6 0
3 years ago
What are the differences, physically and logically, between the two printing configurations: Network-attached Printing and Netwo
evablogger [386]

Answer:

They are essentially the same physically. Logically, the print jobs are handled differently.

Explanation:

7 0
4 years ago
Colin Mackay Inc., a software company with its head office in Amsterdam, has employees across three continents. The company's pr
Andrei [34K]

Answer:

B) shared workspace

Explanation:

There are various terms which are shown below:

Blogging: Blogging is the site in which the person shares its views and opinions about a certain topic. So that it can spread their knowledge throughout the world

Shared workspace: As the name suggests it is a document that is shared with the team members so that they can track any change made by the other team members so that it avoids the duplicate of files. It also reduced the cost and time.

Instant messaging: It is an online chat in which the receiver and the sender communicate with each other in a real-time

Cross-linking: The cross-linking is the technique which links one site to another with a motive to access another site.

So, according to the given scenario, the most appropriate option is b.

7 0
3 years ago
Design a class named Car that has the following fields:
snow_tiger [21]

Answer:

// The class car is defined

public  class Car {

  // instance variable yearModel

  private int yearModel;

  // instance variable make

  private String make;

  // instance variable speed

  private int speed;

 

  // empty constructor

  // with instances inside it

  // the instances are from the question

  public Car(){

      yearModel = 2000;

      make = "Nissan";

      speed = 4;

  }  

  // overloaded constructor

  // constructor defined with three arguments

  public Car(int yearModel, String make, int speed) {

      // the arguments are assigned to the object's variable

      this.yearModel = yearModel;

      this.make = make;

      this.speed =speed;

  }

  // setter(mutator) method

  public void setYearModel(int yearModel){

      this.yearModel = yearModel;

  }

  // setter(mutator) method

  public void setMake(String make){

      this.make = make;

  }

  // setter(mutator) method

  public void setSpeed(int speed){

      this.speed = speed;

  }

  // getter(accessor) method

  public int getYearModel(){

      return yearModel;

   }

  // getter(accessor) method

  public String getMake(){

      return make;

   }

  // getter(accessor) method

  public int getSpeed(){

      return speed;

   }  

  // toString is override to display the car object properties

  public String toString(){

      return "Car's year model: " + getYearModel() + ", make: " + getMake() + ", speed: " + getSpeed();

  }

}

Explanation:

The code is well commented.

4 0
4 years ago
Other questions:
  • Game designers use background images to _______ .
    8·1 answer
  • Which networking model can the network now support that it could not support without the addition of the eighth computer?
    15·1 answer
  • What interprets software instructions and literally tells the other hardware devices what to do, based on the software instructi
    12·1 answer
  • • In your response, please include some examples of the three different types of storage.
    11·2 answers
  • What factors contribute to food wastage
    12·1 answer
  • According to the reading on the course web pages, the earliest usage of cooking began around _____ million years ago.
    12·1 answer
  • All of the following are technical solutions to protecting user privacy except: Group of answer choices Data use policies Anonym
    12·1 answer
  • 11. Damaged seeds would ________ on top of water.
    9·2 answers
  • Only now _______ why you didn't tell me.​
    14·2 answers
  • Select the correct answer from each drop-down menu.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!