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
Mariana [72]
3 years ago
14

Given a string variable named sentence that has been initialized , write an expression whose value is the the very last characte

r in the string referred to by sentence.
Computers and Technology
1 answer:
Blizzard [7]3 years ago
8 0
Strings can usually be dealt with as arrays of characters.

sentence[ -1 ]

sentence.substring( sentence.size() -1 );
You might be interested in
Complete method printPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2, print "Too
Sladkaya [172]

Answer:

The complete method in cpp is given below.  

void printPopcornTime(int bagOunces)  

{  

if(bagOunces<2)  

cout<<"Too small"<<endl;  

else if(bagOunces>10)  

cout<<"Too large"<<endl;  

else  

cout<<6*bagOunces << " seconds"<<endl;  

}  

The program implementing the above method is given below.  

#include <iostream>  

using namespace std;  

//method declared  

void printPopcornTime(int bagOunces);  

int main() {  

//variable declared  

int bagOunces;  

//variable initialized  

bagOunces = 10;  

//method called which accepts integer parameter  

printPopcornTime(bagOunces);  

//program ends  

return 0;  

}  

//method defined  

void printPopcornTime(int bagOunces)  

{  

//output displayed based on the value of the variable  

if(bagOunces<2)  

cout<<"Too small"<<endl;  

else if(bagOunces>10)  

cout<<"Too large"<<endl;  

else  

cout<<6*bagOunces << " seconds"<<endl;  

}  

OUTPUT1  

60 seconds  

Explanation:

Program explanation is given below.

1. The method, printPopcornTime(), having return type as void and accepting an integer parameter, bagOunces, is declared as shown.  

void printPopcornTime(int bagOunces);  

2. Method declaration only contains return type, method name and parameters taken by the method, if any.  

3. Method definition consists of the complete method. All the code to be written inside the method is also included in its definition.  

4. The method definition for printPopcornTime() is shown in the beginning.  

5. The value of the integer parameter is tested using multiple if-else statements.  

6. The output is based on the value of the parameter. The output is ends with a newline inserted by endl.

7. The main() method has a return type integer and takes no parameters. The main() method is declared and defined together unlike as shown for the other method, printPopcornTime().  

8. The integer variable, bagOunces, is declared and initialized inside main().  

9. This variable is passed as parameter to the printPopcornTime() method and calling the method.  

printPopcornTime(bagOunces);  

10. The program ends with a return statement.  

11. All the results are shown based on the different values of the variable, bagOunces. The original output is obtained when the value of bagOunces is 10.  

12. If the value of bagOunces is 1, the message displayed is shown.  

OUTPUT2  

Too small  

13. If the value of bagOunces is 11, the message displayed is shown.  

OUTPUT3  

Too large  

6 0
3 years ago
Overview
ludmilkaskok [199]

Answer:

the answer is in the image below:

Explanation:

5 0
3 years ago
What is the preferred procedure for putting customers on hold​
vesna_86 [32]

Answer/Explanation:

Explain the reason you need to put the caller on hold.

Ask for the person's phone number, in case the conversation is cut off.

Promise to return in a minute—or your best estimate of how long the hold will last. If you think the delay will be longer than a couple of minutes, ask for a number and a time when you can call back.

If, despite your best efforts, the delay is taking longer than anticipated, check in with the caller so that he doesn't feel abandoned. Again, offer to call back, "rather than keep you holding."

When you return to the phone, apologize for the inconvenience and thank the caller for his patience.

Use the caller's name frequently to add a sense of connection.

The first step you can take when putting a caller on hold and making it a satisfying experience is a systematic one. When a caller is on hold, 60 seconds seems like an eternity, so see if you can program the phone system to play music (calming classical or jaunty jazz is best) to break this perception of an interminable wait. Aside from that, however, putting someone on hold in a professional way depends on your behavior. The golden rule to keep in mind is as follows: how would you like to be treated if you were on the other end of the line?

MAKE ME THE BRAINLIEST!!!!!!!!!!!!

8 0
3 years ago
Read 2 more answers
How did transistors revolutionize the world of computers?
Marizza181 [45]

Answer:

Transistors transformed the world of electronics and had a huge impact on computer design. Transistors made of semiconductors replaced tubes in the construction of computers. By replacing bulky and unreliable vacuum tubes with transistors, computers could now perform the same functions, using less power and space.

3 0
3 years ago
If int a = 4, int *b = &amp;a , int **c= &amp;b;<br> what is the value store in c.
Elenna [48]

Answer:

5.

Explanation:

6 0
3 years ago
Other questions:
  • Write a MIPS program to continuously generate the following series of integers: 1, 2, 3, 6, 9, 18, 27, 54, 81, and so on. Use st
    13·1 answer
  • Does group policy management matter without a server environment?
    7·1 answer
  • Write a while statement that prints all even numbers between 1 and 100 to the screen.
    6·1 answer
  • "list at least 3 key performance indicators that should be considered prior to initiating a cloud deployment."
    15·1 answer
  • Discuss advantages and disadvantages of Twisted Pair?
    6·1 answer
  • Solve a single producer, single consumer problem using wait() and notifyAll(). The producer must not overflow the shared buffer,
    5·1 answer
  • Plymouth Colony was originally founded by a group of people called Pilgrims. Since Plymouth did not have an official charter fro
    15·1 answer
  • 9. What command do you enter in the Explorer search box to access the Remote Admin share on the computer named Fin?
    7·1 answer
  • Help101111 avatar can we be friend's please? My name is Keegan. what is yours?
    12·1 answer
  • What type of malware is best known for carrying other malware as a payload?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!