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
mihalych1998 [28]
3 years ago
10

2.3 Code Practice: Question 2

Computers and Technology
1 answer:
IRISSAK [1]3 years ago
3 0

Answer:

Codes are given below:

Explanation:

Since the language is not specified, I am writing it in c++. I have added comments to explain each line

#include <iostream>

using namespace std;

int main() //Start of main function

{

int feet1, feet2 , inches1, inches2, t_feet, t_inches;  //declaring the variables

cout << "Enter the Feet for the first piece of fabric:"<<endl;

cin >> feet1; //this will take the feet piece1 as an input

cout << "Enter the Inches for the first piece of fabric:"<<endl;

cin >> inches1; //this will take the inches piece1 as an input

cout << "Enter the Feet for the second piece of fabric:"<<endl;

cin >> feet2; //this will take the feet piece2 as an input

cout << "Enter the Inches for the second piece of fabric:"<<endl;

cin >> inches2; //this will take the inches piece2 as an input

t_feet = feet1 + feet2;  //adding the feet

t_inches = inches1 + inches2; //adding the inches

if (t_inches> 11)  //checkimg if the inches are greater than 11

{

   t_feet = t_feet + t_inches/12;  //converting inches to feet that are greater than 12

   t_inches = t_inches%12; //getting the remaining inches after converting them to feet

}

cout <<"The total length: " <<  t_feet <<" feet and" << t_inches <<" inches" << endl;

return 0;

}  //End of main function

You might be interested in
You typed the word "weather" when you meant to type the word "whether. " When will Writer or Word flag this as a misspelling or
Alenkasestr [34]

The word flag shows misspelling while typing word "weather" instead of "whether"  is depends on the rest of the sentence and how you have your settings for grammar and spell checker.

<h3>What is word flag or spell checker?</h3>

Word flag or spell checker is the tool or software which helps to identify the misspelling or a grammar problem while typing.

The word "weather"  is typed when there was  to type the word "whether. "

Now, before checking that, when will Writer or Word flag this as a misspelling or a grammar problem, first we have to understand the meaning of both the word.

Word "weather"  is the state of atmosphere for different conditions of temperature, pressure, and humanity. While the word "whether " is the expression of confusion between two things.

The option given for this problem are,

  • Depends on the rest of the sentence and how you have your settings for grammar and spell checker
  • Never
  • All the time.

Word flag, tells the incorrect word, spelling or grammatical error in a sentence.

To identify a particular word which is misplaced in place of another almost similar spelled word, it checks the other word and sentence.

If the particular word does not match with the sentence, the  word flag or spell checker shows the error.

Hence, the word flag shows misspelling while typing word "weather" instead of "whether"  is depends on the rest of the sentence and how you have your settings for grammar and spell checker.

Learn more about the spell checker here;

brainly.com/question/515655

6 0
2 years ago
Professor Midas drives an automobile from Newark to Reno along Interstate 80. His car’s gas tank, when full, holds enough gas
zmey [24]

Answer:

The GREEDY Algorithm

Explanation:

Based on the situation given in question, the Greedy algorithm shall give the optimal solution to professor

Suppose that the cities are at locations0 =x0< x1< . . . < x

We shall use the induction method to prove that G is the optimal solution valid for numbers less than n

We assume another solution Z which we initially consider to be optimum as well, based on that when Z fills the tank, it fills it to full level

Let us state the values in case of n intervals. Given below, we say that g1 is the first stop and z1 is also the first stop.

This can be written as ;

G=g1, g2, . . . , gk

Z=z1, z2, . . . , zk’

Here k’ <= k and k < n

Let I be an idex where for the first time gi is not equal to zi

Considering t= maxi Zi

Z′=g1, z2, z3, . . . , zk′

Now since z2, z3, . . . , zk′ should be an optimal stopping pattern for the problem otherwise we have chosen Z, with smaller gas filling (not feasible)

Using induction hypothesis we conclude thatg2, . . . , gk is an optimal stopping pattern, which is based on greedy algorithm

7 0
3 years ago
What is the meaning of HML​
trapecia [35]

Answer:

Explanation:

Hit my line

4 0
2 years ago
Read 2 more answers
Write a function file that accepts the values of r, a and n as arguments and uses a for loop to return the sum of the first n te
Murrr4er [49]

Given, a = 3, r = 1/2, n = 10

%r is common ratio

%n is number of terms

%a is the first term of the series

Sum = 0;

a = 3;

r = 1/2;

for i = 0 : 1 :  10;

Sum = Sum + a * r ^ i;

end

Sum


7 0
3 years ago
Define types of hacker ?plz help me with this question​
denis-greek [22]

Answer:

the types of hacker attacks and techniques. White Hat Hackers. Black Hat Hackers. Gray Hat Hackers. Script Kiddies.

Explanation:

i don't know if this can help you

8 0
2 years ago
Read 2 more answers
Other questions:
  • What is a bus master?
    14·1 answer
  • There is no reason to study the works of famous photographers because they will make you less creative.
    5·2 answers
  • The ____ provides access to the Internet may also be internal.
    14·2 answers
  • What are the functions of online gaming communities?
    12·1 answer
  • When discussing the data-modeling building blocks, anything (a person, a place, a thing, or an event) about which data are to be
    15·1 answer
  • Jason is working on a project that requires him to manage a huge amount of data. The spreadsheet he is working on has data relat
    10·1 answer
  • Write a program that allows two players to play a game of tic-tac-toe. Use a two dimensional char array with three rows and thre
    7·1 answer
  • A computer (mainframe, server, or workstation) that has an operating system enabling _____________ to access it at the same time
    11·1 answer
  • why does planets orbit the sun? asap i give brainlist i know it on that subject i dont know what else goes with it
    10·1 answer
  • PYTHON
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!