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
murzikaleks [220]
3 years ago
8

Field names should NOT start with a(n) - hyphen (-) Oa asterisk (*) space()

Computers and Technology
1 answer:
Musya8 [376]3 years ago
6 0
A field name should not begin with a spacey
You might be interested in
Consider the class Money declared below. Write the member functions declared below and the definition of the overloaded +. Modif
disa [49]

Answer: Provided in the explanation section

Explanation:

#include<iostream>

using namespace std;

class Money{

  private:

      int all_cents;

  public:

      Money();

      double get_value() const;

      Money(int,int);

      void printamount();

      friend Money operator+(const Money&, const Money&);

      friend ostream& operator<<(ostream&, const Money&);

      friend istream& operator>>(istream&, Money&);

};

Money::Money(){all_cents=0;}

double Money::get_value() const{return all_cents/100.0;}

Money::Money(int dollar ,int cents){

  all_cents = dollar*100+cents;

}

void Money::printamount(){

  cout<<"$"<<get_value()<<endl;

}

Money operator+(const Money& m1, const Money& m2){

  int total_cents = m1.all_cents + m2.all_cents;

  int dollars = total_cents/100;

  total_cents %=100;

  return Money(dollars,total_cents);

}

ostream& operator<<(ostream& out, const Money& m1){

  out<<"$"<<m1.get_value()<<endl;

  return out;

}

istream& operator>>(istream& input, Money& m1){

  input>>m1.all_cents;

  return input;

}

int main(){

 

  Money m1;

  cout<<"Enter total cents: ";

  cin>>m1;

  cout<<"Total Amount: "<<m1;

 

  Money m2 = Money(5,60);

  Money m3 = Money(4,60);

  cout<<"m2 = ";m2.printamount();

  cout<<"m3 = ";m3.printamount();

  Money sum = m2+m3;

  cout<<"sum = "<<sum;

 

}

cheers i hope this helped !!

5 0
3 years ago
Life without internet points
Lady_Fox [76]
You have to ask a question to get an answer
7 0
3 years ago
Read 2 more answers
What should you include in a persuasive speech
Vlad [161]

Answer:

Come up with a controversial topic, one that make your listeners think

Research the topic thoroughly that you have chosen

Understand the perspective of your audience. Keep your goal in mind. You are trying to persuade the audience to do or believe something .

7 0
3 years ago
Using the flowchart below, what value when entered for Y will generate a mathematical error and prevent our flowchart from being
nexus9112 [7]

Answer:

The answer is the last choice that is "None of these values will produce a mathematical error".

Explanation:

In this question, the above given choice correct because neither of the flowchart procedures could trigger a mathematical error. This error could not be induced by multiplication, addition and subtraction, and the only division by 15. It is the only divide by 0, that's why the above flowchart will produce a mathematical error.

4 0
3 years ago
ANSWERED CORRECT BELOW
ch4aika [34]

Answer:

Explanation:

The Java code provided in the question works as intended. The nextInt() correctly outputs the random value from 1-10 while the nextInt(int min, int max) correctly outputs random values between the int and max parameters. I changed the int/max arguments to 3 and 12 and ran the program to demonstrate that the program is running as intended. Output can be seen in the attached picture below.

8 0
3 years ago
Other questions:
  • A ___________ is an algorithm for which it is computationally infeasible to find either (a) a data object that maps to a pre-spe
    5·1 answer
  • Which type of object is used to organize and store data in Microsoft access 2013
    5·2 answers
  • Write a program that allows a user to input words at the command line. Your program should stop accepting words when the user en
    10·1 answer
  • What are 3 characteristics of syndrome E?
    13·1 answer
  • Which term is used to describe a password-protected, encrypted data file that verifies the identity of the sender of a message?
    8·1 answer
  • Who here has a crush on jk from bts but feels more mature than him
    10·2 answers
  • takes the perspective that a program describes what the solution to a problem is, not how that problem is solved. Select one: a.
    5·1 answer
  • In this exercise we will practice using loops to handle collections/containers. Your job is to write a program that asks the use
    6·1 answer
  • What are some innovations that television has undergone since its original invention ?
    11·1 answer
  • A network of computers that provides access to information on the web.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!