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
pshichka [43]
3 years ago
13

What does the statement that follows do? double gallons[6] = { 12.75, 14.87 }; a. It assigns the two values in the initializatio

n list to the first two elements but leaves the other elements with the values currently in memory. b. It assigns the two values in the initialization list to the first and second elements, third and fourth elements, and fifth and sixth elements. c. This statement is invalid. d. It assigns the two values in the initialization list to the first two elements and default values to the other elements.
Computers and Technology
1 answer:
Serhud [2]3 years ago
3 0

Answer:

It assigns the two values in the initialization list to the first two elements and default values to the other elements.

Explanation:

Given

The array initialization

Required

Interpret the statement

double gallons[6] implies that the length/size of the array gallons is 6.

In other words, the array will hold 6 elements

{12.75, 14.87} implies that only the first two elements of the array are initialized ; the remain 4 elements will be set to default 0.

You might be interested in
Renee just got on the freeway to go to her cousin's house in Denver. She is driving 50 miles per hour. Her sister Kim left one h
defon

let's say they catch-up to each other after t hour.

so

in t hour distance travelled by Renee

d = speed × time = 50t

in t hour distance travelled by Kim

d = speed × time = 60(t-1) + 0×1 = 60(t-1)

Note: here kim didn't covered any distance in first hour and in rest t-1 hour it travelled all distance

now.as distance travelled by both is same so

60(t-1) = 50t

60t -60 = 50t

adding 60 both sides

60t = 50t+60

subtracting 50t both sides

60t -50t = 50t+60 - 50t

10t = 60

dividing by 10 both sides

t = 60/10 = 6

so in 6 hour both will catch-up to each other

3 0
3 years ago
Instructions
e-lub [12.9K]

Answer:

See explaination

Explanation:

dateType.h

#ifndef dateType_H

#define dateType_H

class dateType

{

public:

void setDate(int month, int day, int year);

//Function to set the date.

//The member variables dMonth, dDay, and dYear are set

//according to the parameters.

//Postcondition: dMonth = month; dDay = day;

// dYear = year

int getDay() const;

//Function to return the day.

//Postcondition: The value of dDay is returned.

int getMonth() const;

//Function to return the month.

//Postcondition: The value of dMonth is returned.

int getYear() const;

//Function to return the year.

//Postcondition: The value of dYear is returned.

void printDate() const;

//Function to output the date in the form mm-dd-yyyy.

void isLeapYear() const;

dateType(int month = 1, int day = 1, int year = 1900);

//Constructor to set the date

//The member variables dMonth, dDay, and dYear are set

//according to the parameters.

//Postcondition: dMonth = month; dDay = day; dYear = year;

// If no values are specified, the default

// values are used to initialize the member

// variables.

private:

int dMonth; //variable to store the month

int dDay; //variable to store the day

int dYear; //variable to store the year

};

#endif

dateType.cpp

#include <iostream>

#include "dateType.h"

using namespace std;

void dateType::setDate(int month, int day, int year)

{

// Checking month is valid

while(month<1 || month>12)

{

cout << "Enterd month "<<month<< " is wrong"<<endl;

cout << "Enter correct month"<<endl;

cin>>month;

}

dMonth = month;

// Checking date is valid

while(day<1 || day>31)

{

cout << "Enterd date "<<day<<" is wrong"<<endl;

cout<<"Enter correct date"<<endl;

cin>>day;

}

dDay = day;

int count_digits = 0;

int flag=0;

int year1;

// Counting number of digits in year

while(flag==0)

{

year1=year;

count_digits=0;

while (year) {

year /= 10;

count_digits++;

}

if(count_digits != 4)

{

cout << "Enterd year "<<year1<<" is wrong"<<endl;

cout<<"Enter correct year"<<endl;

cin>>year;

flag=0;

}

else

flag=1;

}

dYear = year1;

}

int dateType::getDay() const

{

return dDay;

}

int dateType::getMonth() const

{

return dMonth;

}

int dateType::getYear() const

{

return dYear;

}

void dateType::printDate() const

{

cout << dMonth << "-" << dDay << "-" << dYear;

}

void dateType::isLeapYear() const

{

if ( dYear%400 == 0)

cout<<endl<<dYear<< " is leap year.\n";

else if ( dYear%100 == 0)

cout<<endl<<dYear<< " is leap year.\n";

else if ( dYear%4 == 0 )

cout<<endl<<dYear<< " is leap year.\n";

else

cout<<endl<<dYear<< " is not leap year.\n";

}

//Constructor with parameters

dateType::dateType(int month, int day, int year)

{

// Checking month is valid

while(month<1 || month>12)

{

cout << "Enterd month "<<month<< " is wrong"<<endl;

cout << "Enter correct month"<<endl;

cin>>month;

}

dMonth = month;

// Checking date is valid

while(day<1 || day>31)

{

cout << "Enterd date "<<day<<" is wrong"<<endl;

cout<<"Enter correct date"<<endl;

cin>>day;

}

dDay = day;

int count_digits = 0;

int flag=0;

int year1;

// Counting number of digits in year

while(flag==0)

{

year1=year;

count_digits=0;

while (year) {

year /= 10;

count_digits++;

}

if(count_digits != 4)

{

cout << "Enterd year "<<year1<<" is wrong"<<endl;

cout<<"Enter correct year"<<endl;

cin>>year;

flag=0;

}

else

flag=1;

}

dYear = year1;

}

main.cpp

#include<iostream>

#include "dateType.h"

using namespace std;

int main()

{

dateType *dt1=new dateType();

cout<<"Date is "<<endl;

dt1->printDate();

cout<<endl;

dt1->isLeapYear();

cout<<endl;

dateType *dt2=new dateType(11,14,2019);

cout<<"Date is "<<endl;

dt2->printDate();

cout<<endl;

dt2->isLeapYear();

cout<<endl;

dt2->setDate(13,32,2016);

cout<<"Date is "<<endl;

dt2->printDate();

cout<<endl;

dt2->isLeapYear();

cout<<endl;

dt1->setDate(10,10,198);

cout<<"Date is "<<endl;

dt1->printDate();

cout<<endl;

dt1->isLeapYear();

cout<<endl;

system("pause");

return 0;

}

6 0
3 years ago
Which of the following will not cause the supply of internet service to increase?
Rus_ich [418]

Answer:

c

Explanation:

5 0
2 years ago
Write a program that computes the area and perimeter of a rectangle given its radius
mezya [45]
D sag gg FYI hbd su such ja dash us di ggs xx NJ
7 0
3 years ago
Using the arrow key you can adjust the position of a selection in increments of
nadezda [96]

Answer:

Ok

Explanation:

8 0
3 years ago
Other questions:
  • 5. The coordinates of triangle ABC are A(-7, 3), B(3, -7) and C(8. 8)
    9·2 answers
  • __________ is the electronic transmission of signals for communications, which enables organizations to carry out their processe
    8·1 answer
  • What is the minimum number of data points you should usually have to look for signs of improvement on a run chart?
    8·1 answer
  • Which guideline should you use when downloading software from the Internet?
    15·1 answer
  • Where are the worksheet tabs located
    7·1 answer
  • This organization created web standards to be followed in the creation and contentof a web page​
    8·1 answer
  • DERECTIONS: Identify all the computer software that you need for the following entrepreneurial activities. Refer your answer fro
    5·1 answer
  • when demonstrating 2022 altima’s parking assistance, what steering feature should you mention when pointing out how easy the veh
    10·1 answer
  • Unscramble the given word and identify the correct statement about it. ATTEPLSR
    10·1 answer
  • You need to install a 32-bit application on a 32-bit version of windows 10. In which default directory will the application be i
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!