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
olchik [2.2K]
3 years ago
10

Assume that sentence is a variable of type String that has been assigned a value. Assume furthermore that this value is a String

consisting of words separated by single space characters with a period at the end. For example: "This is a possible value of sentence." Assume that there is another variable declared, firstWord, also of type String. Write the statements needed so that the first word of the value of sentence is assigned to firstWord. So, if the value of sentence were "Broccoli is delicious.", your code would assign the value "Broccoli" to firstWord.
Computers and Technology
1 answer:
disa [49]3 years ago
5 0

Answer:

//get the sentence from the user

          Console.WriteLine("Enter your sentence");

           //read the user information

           string ans = Console.ReadLine();

           //check if sentence ends with period

          if(!ans.EndsWith("."))

           {

               Console.WriteLine("Sentence should end with period");

               Environment.Exit(0);

           }

           //declear empty string firstword

           string firstWord = "";

           //split the requested sentence using single space character

          string[] splitans =  ans.Split(' ');

           //assign firstword

           firstWord = splitans[0];

           //print out firstword

          Console.WriteLine(firstWord);

Explanation:

The program uses c#.

You might be interested in
Assume that price is an integer variable whose value is the price (in US currency) in cents of an item. Write a statement that p
aivan3 [116]

Answer:

// here is program in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variable

int price;

cout<<"enter the price: ";

// read the price

cin>>price;

// find the dollars

int doll=price/100;

// find the cents

int cent=price%100;

// print the dollars and cents

cout<<doll<<" dollars and "<<cent<<" cents.";

return 0;

}

Explanation:

Read the price from user and assign it to variable "price".Then find the dollars by dividing the price with 100 and to find cents calculate modulus 100 of price. Then print both the value.

Output:

enter the price: 4321                                                                                                      

43 dollars and 21 cents.

3 0
4 years ago
Activities provided for the satisfaction of others and consumed at the time of purchase<br> are…
Natasha2012 [34]
The answer is services
6 0
3 years ago
Roadband is a network connection that
Alex_Xolod [135]

Answer:

a.Allows for more information to be sent in a shorter period of time

Explanation:

Broadband is a network connection that allows for higher speed in terms of bits per second. In other words Broadband allows for higher number of packets to be sent over the network in a short interval of time.

It enables better end user experience in terms of web browsing, online video streaming, IP based calls etc.

Among the given options, option a provides the relevant meaning of broadband.

4 0
3 years ago
What does a companys code of ethics cover
never [62]

Answer:

A code of ethics and professional conduct outlines the ethical principles that govern decisions and behavior at a company or organization. They give general outlines of how employees should behave, as well as specific guidance for handling issues like harassment, safety, and conflicts of interest.

7 0
2 years ago
What is professional education? <br><br><br><br><br>Please help me to do this.​
allochka39001 [22]

Answer:

Professional education is a formalized approach to specialized training in a professional school through which participants acquire content knowledge and learn to apply techniques. Although content is what the participant is expected to learn by attending professional school, such an education also helps the participant acquire the competencies needed for proper practice and behavior. Some common goals of professional education include incorporating the knowledge and values basic to a professional discipline; understanding the central concepts, principles, and techniques applied in practice; attaining a level of competence necessary for responsible entry into professional practice; and accepting responsibility for the continued development of competence. It is designed to produce responsible professionals and then to ensure their continuing competence in the profession by helping them recognize and understand the significance of advancing professional knowledge and improving standards of practice. It involves the translation of learning to practice and is intended to prevent occupations and professionals from becoming obsolete.

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • As the design phase of an SDLC begins, programming languages, development tools, and application software needed for the new inf
    13·1 answer
  • What is the purpose of ergonomics in the workplace? A.Keep workers safe and injury free
    5·2 answers
  • Which of the following types of memory extends the actual physical memory of a computer by copying blocks of data from the memor
    11·1 answer
  • Hi i need to know how much watt hours divided by month total
    14·1 answer
  • Which of these is an aggregator?
    5·2 answers
  • The length property of the String object returns
    15·1 answer
  • Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankfuls of gasoline
    10·1 answer
  • Choose a common cloud-based application from the lesson.(Infrastructure as a service, Software as a service, Platform as a servi
    5·1 answer
  • Use a while loop to output the even number from 100 to 147? This is python
    10·1 answer
  • write the few lines of code that prompts the user to enter a series of exam scores, stopping when the user has entered an exam s
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!