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
il63 [147K]
2 years ago
13

Declare a struct named PatientData that contains two integer data members named heightInches and weightPounds. Sample output for

the given program:Patient data: 63 in, 115 lbs#include using namespace std;/* Your solution goes here */int main() {PatientData lunaLovegood;lunaLovegood.heightInches = 63;lunaLovegood.weightPounds = 115;cout << "Patient data: "<< lunaLovegood.heightInches << " in, "<< lunaLovegood.weightPounds << " lbs" << endl;return 0;}
Computers and Technology
1 answer:
boyakko [2]2 years ago
8 0

Answer:

struct PatientData{

   int heightInches, weightPounds;

};

Explanation:

In order to declare the required struct in the question, you need to type the keyword <em>struct</em>, then the name of the struct - <em>PatientData</em>, <em>opening curly brace</em>, data members - <em>int heightInches, weightPounds;</em>, <em>closing curly brace</em> and <em>a semicolon</em> at the end.

Note that since the object - lunaLovegood, is declared in the main function, we do not need to declare it in the struct. However, if it was not declared in the main, then we would need to write <em>lunaLovegood</em> between the closing curly brace and the semicolon.

You might be interested in
Declare a struct named PatientData that contains two integer data members named heightInches and weightPounds. Sample output for
boyakko [2]

Answer:

struct PatientData{

   int heightInches, weightPounds;

};

Explanation:

In order to declare the required struct in the question, you need to type the keyword <em>struct</em>, then the name of the struct - <em>PatientData</em>, <em>opening curly brace</em>, data members - <em>int heightInches, weightPounds;</em>, <em>closing curly brace</em> and <em>a semicolon</em> at the end.

Note that since the object - lunaLovegood, is declared in the main function, we do not need to declare it in the struct. However, if it was not declared in the main, then we would need to write <em>lunaLovegood</em> between the closing curly brace and the semicolon.

8 0
2 years ago
Write a copy constructor for carcounter that assigns origcarcounter.carcount to the constructed object's carcount. sample output
Drupady [299]

#include <iostream>

using namespace std;

class CarCounter {

  public:

     CarCounter();

     CarCounter(const CarCounter& origCarCounter);

     void SetCarCount(const int count) {

         carCount = count;

     }

     int GetCarCount() const {

         return carCount;

     }

  private:

     int carCount;

};

CarCounter::CarCounter() {

  carCount = 0;

  return;

}

CarCounter::CarCounter(const CarCounter &p){

carCount = p.carCount;

}

void CountPrinter(CarCounter carCntr) {

  cout << "Cars counted: " << carCntr.GetCarCount();

  return;

}

int main() {

  CarCounter parkingLot;

  parkingLot.SetCarCount(5);

  CountPrinter(parkingLot);

  return 0;

}

Sample output:  

Cars Counted: 5

8 0
2 years ago
Read 2 more answers
Which data type change will require the app builder to perform the additional steps in order to retain existing functionalities?
Readme [11.4K]

Answer:

Option D is the correct option.

Explanation:

The following option is correct because the lead alteration from number to text and the number to text types of data will reconstruct the important number of the app builder to accomplish those steps which is extra to continue to have that functionality which is in the existence. That's why the app builder has to be reconstructed the types of data for the custom fields.

7 0
1 year ago
A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: the name of the clie
timama [110]

Answer:

see explaination

Explanation:

Java code

//Header file section

import java.util.Scanner;

import java.io.*;

//main class

public class SalesTestDemo

{

//main method

public static void main(String[] args) throws IOException

{

String inFile;

String line;

double total = 0;

Scanner scn = new Scanner(System.in);

//Read input file name

System.out.print("Enter input file Name: ");

inFile = scn.nextLine();

FileReader fr = new FileReader(new File(inFile));

BufferedReader br = new BufferedReader(fr);

System.out.println("Name \t\tService_Sold \tAmount \tEvent Date");

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

line = br.readLine();

//Each line contains the following, separated by semicolons:

//The name of the client, the service sold

//(such as Dinner, Conference, Lodging, and so on)

while(line != null)

{

String temp[] = line.split(";");

for(int i = 0; i < temp.length; i++)

{

System.out.print(temp[i]+"\t");

if(i == 1)

System.out.print("\t");

}

//Calculate total amount for each service category

total += Double.parseDouble(temp[2]);

System.out.println();

line = br.readLine();

}

//Display total amount

System.out.println("\nTotal amount for each service category: "+total);

}

}

inputSale.txt:

Peter;Dinner;1500;30/03/2016

Bill;Conference;100.00;29/03/2016

Scott;Lodging;1200;29/03/2016

Output:

Enter input file Name: inputSale.txt

Name Service_Sold Amount Event Date

=====================================================

Peter Dinner 1500 30/03/2016

Bill Conference 100.00 29/03/2016

Scott Lodging 1200 29/03/2016

Total amount for each service category: 2800.0

3 0
2 years ago
Which decimal value (base 10) is equal to the binary number 1012?
GaryK [48]

Answer:

The decimal value of 101₂² base 2 = 25 base 10

Explanation:

The number 101₂² in decimal value is found as follows;

101₂ × 101₂ = 101₂ + 0₂ + 10100₂

We note that in 101 + 10100 the resultant 2 in the hundred position will have to be converted to a zero while carrying over 1 to the thousand position to give;

101₂ + 0₂ + 10100₂ = 11001₂

Therefore;

101₂² =  11001₂

We now convert the result of the square of the base 2 number, 101², which is 11001₂ to base 10 as follows;

Therefore converting 11001₂ to base 10 gives;

11001₂= 1 × 2⁴ + 1 × 2³ + 0 × 2² + 0 × 2 ¹ + 1 × 2⁰

Which gives;

16 + 8 + 0 + 0 + 1 = 25₁₀.

7 0
1 year ago
Other questions:
  • 8. In time series, which of the following cannot be predicted? A) large increases in demand B) technological trends C) seasonal
    11·1 answer
  • Which of the following is NOT a method in which a macro can be run?
    10·1 answer
  • PYTHON QUESTION
    15·1 answer
  • You are the IT security administrator for a small corporate network. Samuel Garcia (sgarcia) has been away on vacation and has f
    9·1 answer
  • Suppose that each row of an n×n array A consists of 1’s and 0’s such that, in any row i of A, all the 1’s come before any 0’s in
    15·1 answer
  • The variable grade can have any real number value from 0 to 100. Ask the user to enter a grade in numerical form. Write an if-el
    9·1 answer
  • .Ten pounds of candy were prepared for the school party.
    10·1 answer
  • Look at the following array definition:
    11·1 answer
  • A program is divided into 3 blocks that are being compiled on 3 parallel computers. Each block takes an Exponential amount of ti
    6·1 answer
  • Create an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and th
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!