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
What is the output of the following function if the array nums contains the values 1 2 3 4 5 int backwards(int nums[]) { for (x
AnnZ [28]

Answer:

The output of the program is:

5 4 3 2 1

Explanation:

The output of the array will be the reverse of the elements in the array since the initial array was 1 2 3 4 5. The function backwards uses a for statement to accomplish this. Starting at index 4 which is the last element, since there are five elements (indexes from 0-4), the for statement prints out the xth element, decreases x by 1 and continues until the condition is no longer true.

4 0
3 years ago
Write a C# program named ProjectedRaises that includes a named constant representing next year’s anticipated 4 percent raise for
nydimaria [60]

Answer:

using System;

class ProjectedRaises {

 static void Main() {

     const float raise = 0.04f;

     double salary1 = 0.0f,salary2 = 0.0f,salary3 = 0.0f;

Console.WriteLine("Current salary for each employee: ");

     salary1 = Single.Parse(Console.ReadLine());

     salary2 = Single.Parse(Console.ReadLine());

     salary3 = Single.Parse(Console.ReadLine());

     salary1 = salary1 + raise * salary1;

     salary2 = salary2 + raise * salary2;

     salary3 = salary3 + raise * salary3;

     Console.WriteLine("Next year salary for the employees are: ");

     Console.WriteLine(Math.Round(salary1));

     Console.WriteLine(Math.Round(salary2));

     Console.WriteLine(Math.Round(salary3));

}

}

Explanation:

This declares and initializes variable raise as a float constant

     const float raise = 0.04f;

This declares the salary of each employee as double

     double salary1 = 0.0f,salary2 = 0.0f,salary3 = 0.0f;

This prompts the user for the salaries of the employee

Console.WriteLine("Current salary for each employee: ");

The next three lines get the salary of the employees

<em>      salary1 = Single.Parse(Console.ReadLine());</em>

<em>      salary2 = Single.Parse(Console.ReadLine()); </em>

<em>      salary3 = Single.Parse(Console.ReadLine()); </em>

The next three lines calculate the new salaries of the employees

<em>      salary1 = salary1 + raise * salary1;</em>

<em>      salary2 = salary2 + raise * salary2;</em>

<em>      salary3 = salary3 + raise * salary3;</em>

This prints the header

     Console.WriteLine("Next year salary for the employees are: ");

The next three lines print the new salaries of the employees

     Console.WriteLine(Math.Round(salary1));

     Console.WriteLine(Math.Round(salary2));

     Console.WriteLine(Math.Round(salary3));

7 0
3 years ago
Can Any body Define what is search engine in a simple language quick please​
Komok [63]

Answer:

It is the SQL of WWW. Or in other words, it is the web tool that helps the users in locating the required information on the WWW. Various top search engines are like Google, MSN, and Yahoo. And the information that is gathered by the spider is used for creating the searchable index for the content on the web. This spider crawls according to the search engine algorithm and that is known as web crawling.

Explanation:

Please check the answer section.

6 0
3 years ago
Assume that sentence is a variable that has been associated with a string consisting of words separated by single space characte
sleet_krkn [62]

The right code is,

secondWord = sentence.substr (sentence.find ("`") + 1);

secondWord = secondWord.substr (0, secondWord.find ("`"));

3 0
3 years ago
Read 2 more answers
Gina is upgrading your computer with a new processor. She installed the processor into your motherboard and adds the cooling sys
tigry1 [53]

Answer:

The answer is option d.

8 0
3 years ago
Read 2 more answers
Other questions:
  • How has technology influenced space exploration?
    13·1 answer
  • What is the keyboard shortcut Ctrl+Z used for?
    14·2 answers
  • What is a IT form? any help would be great thnx
    14·2 answers
  • Is there a syntax error in the following code? bool hourlyWorker = true; if (hourlyWorker) cout &lt;&lt; "The employee is an hou
    12·1 answer
  • Please help quickly!!! which of the following is not a peripheral?
    8·2 answers
  • Jane is creating a slide that will have a large heading and number of bullet points below it. What slide format should she use?
    12·1 answer
  • _____ provides the best video resolution. *<br><br> VGA<br> HDMI<br> USB<br> DVI
    7·1 answer
  • the ghost adventures team uses a variety of tools and technology in investigations. which one is described as an adjustable freq
    9·1 answer
  • In cells D6 through D8, enter formulas to calculate the values of the stocks. The formulas should multiply the number of shares
    11·1 answer
  • Find 10 real world challenges and their corresponding solutions
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!