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
MissTica
3 years ago
6

4.2 lesson practice help plzs

Computers and Technology
1 answer:
sertanlavr [38]3 years ago
8 0

The output is 21 because c is incremented by 3 until it surpasses 10 and the value of c is added to sum each time the loop runs.

I hope this helps!

You might be interested in
Is rhis app plagerism free
ollegr [7]
Yes,yes it is.All you do is get help
3 0
3 years ago
Assume that name is a variable of type String that has been assigned a value. Write an expression whose value is a String contai
Stella [2.4K]

Corrected (Modified) Question:

i. Assume that name is a variable of type String that has been assigned a value. Write an expression whose value is a String containing the last character of the value of name. So if the value of name were "Smith" the expression's value would be "h".

ii. Given a String variable named sentence that has been initialized, write an expression whose value is the number of characters in the String referred to by sentence.

Explanation of the corrected question

The whole question has been numbered (i) and (ii) just to separate or divide it into clearer sub questions.

Some parts of the question has also been removed since they are repetition of a part of the question.

Answer:

(i) name.charAt(name.length() - 1)

(ii) sentence.length()

Explanation:

No language  has been specified in the question for the code to be written in. However, I have chosen to write it in Java.

(i) In Java, to get a particular character in a string <em>str</em>, the function, charAt(x) is used, where x in the function represents the index of the character to be fetched. This is written as str.charAt(x).

In our case, x is the index of the last character in our string. To get the index of the last character in a string say <em>str</em>, the length of the string itself is used. However, indexing starts at zero. Therefore, to get the index, it will be the 1 subtracted from the length of the string as follows:

str.length() - 1

But note that, to get the length of a string, the method length() is used. For example if,

String str = "omobowale";

str.length() will return 9

Now to the question at hand, our string variable name is <em>name. </em>

Therefore to get its last character, we write:

<em>name.charAt(name.length() - 1)</em>

So if;

name = "Smith";

name.charAt(name.length() - 1) will return "h"

(ii) As explained in (i) above, to get the length (number of characters) of the variable string <em>sentence, </em>we simply write;

<em>sentence.length()</em>

<em>PS: The length of  a string is the number of characters present in the string.</em>

Hope this helps!

3 0
3 years ago
What is a relational database management system and how does it relate to a database administrator?
nydimaria [60]

Answer: A database management system tends to support administration, development, and use of the platforms. A Relation Database Management System (RDBMS) is referred to as a type of Database Management System (DBMS) that consists of a structure(row-based table) that tends to connect data elements and also involve functions that are supposed to maintain accuracy, security, consistency and integrity of the data.

6 0
4 years ago
Read three numbers from user input. Then, print the product of those numbers. Ex: If input is 2 3 5, output is 30. Note: Our sys
Murrr4er [49]

Answer:

This is written in Python 3. And I am assuming that since the output is "30", which is derived from the inputs 2, 3, and 5, these three are multiplied to get the final output.

<em>fnum = int(input('Enter first number: '))</em>

<em>snum = int(input('Enter second number: '))</em>

<em>tnum = int(input('Enter third number: '))</em>

<em />

<em>output = (fnum * snum) * tnum</em>

<em>print ("The output is:", output)</em>

Explanation:

For the first three lines, we ask the user to input 3 numbers. At the same time, we are also converting these inputs into int type.  

  • fnum = int(input('Enter first number: '))
  • snum = int(input('Enter second number: '))
  • tnum = int(input('Enter third number: '))

The breakdown here is as follows:

  • fnum, snum, and tnum are user-defined variables which will hold the user's inputs.
  • int() is needed to define that everything inside it is an integer. If we don't first convert the input to integers, we will receive an error during multiplication saying that we cannot multiply non-int type variables. You can also choose to use Float here instead of Int - in which case, it will be float().
  • input('Enter first number:' )) - this is the part where we ask the user to enter the number they want.

Put together, it looks like this:

<em>variable = int(input('Your Custom Text Here: '))</em>

<em />

The next block would be:

  • output = (fnum * snum) * tnum

This is where we multiply the first, second, and third number to get to the output.

Finally, we print it with:

  • print ("The output is:", output)

Concatenating a string and variable looks like this.

print("text here", output) - when concatenating a string and a variable, simply add a comma after the quotation marks of the string.

8 0
3 years ago
What is the difference between the web and the internet?
Naddika [18.5K]
The Web is just one of the ways that information can be disseminated over the Internet
4 0
3 years ago
Other questions:
  • Additional rows and columns are inserted into a table by using the _____ tab
    7·2 answers
  • The more critical a component or service, the higher the level of availability required. True False
    5·1 answer
  • You have implemented a network where each device provides shraed files with all other devices on the network. what type of netwo
    10·1 answer
  • Which command is used to combine two or more cells together into one cell?
    14·2 answers
  • 1. The trucks hauling asphalt have a maximum capacity of 5 US tons (10,000 lbs) 2. The standard road lane is 12 feet wide. 3. As
    14·1 answer
  • Why is it a good idea to defrag your hard disk regularly?
    9·1 answer
  • central, secure database in which Windows stores hardware and software configuration information and system security policies is
    12·1 answer
  • Tech A states that modern vehicles use asbestos as the brake material. Tech B states that asbestos is no longer used in brakes.
    8·1 answer
  • The ________ networks operate close to the legitimate free hotspots and typically provide stronger signals
    8·1 answer
  • Clara works behind a computer all day. She gets a lot of headaches, and her eyes have been hurting her lately. Her doctor diagno
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!