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
Anyone help pls ? Complete the code below to add css to make the background of the web page orange.
pochemuha

Answer:

In HTML file

<body style="background-color:orange;">

Or

In CSS file

body {

background-color: orange;

}

7 0
3 years ago
Why might a peer-to-peer network not be the best choice for a large corporate office setting?
omeli [17]

Answer:

a it is less private

Explanation:

8 0
3 years ago
add is a method that accepts two int arguments and returns their sum. Two int variables, euroSales and asiaSales, have already b
Oduvanchick [21]

Answer:

// here is code in Java.

// package

import java.util.*;

// class definition

class Main

{

   // method that return sum of two sale value

   public static int Add(int euroSales,int asiaSales)

   {

       // return the sum

       return euroSales+asiaSales;

   }

   //main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // variables

       int euroSales=100;

       int asiaSales=150;

       int eurasiaSales;

        // call the function

       eurasiaSales=Add(euroSales,asiaSales);

        // print the sum

       System.out.println("total sale is:"+eurasiaSales);

   }catch(Exception ex){

       return;}

}

}

Explanation:

Declare and initialize two variables "euroSales=100" and "asiaSales=150". Declare another variable eurasiaSales. Call the method Add() with euroSales and asiaSales as parameter. This method will add both the value and return the sum.This sum will be assigned to variable eurasiaSales.Then print the sum.

Output:

total sale is:250  

8 0
4 years ago
What is the least effective way to create balance and flow in your life
sweet [91]
Act on your emotions not your first thought of something wrong
6 0
4 years ago
Read 2 more answers
Frost wedging happens when _____.
Mila [183]
I believe the correct answer from the choices listed above is option D. Frost wedging happens when rocks break from repeated exposure to the Sun's heat. It <span> is caused by the repeated freeze-thaw cycle of water in extreme climates. Hope this answers the question.</span>
8 0
4 years ago
Read 2 more answers
Other questions:
  • What filter gives a “squeezed” effect to an image?
    14·2 answers
  • The following memo does not follow the correct format. What should be changed? To: Stacy, Allen, and Emma Date: August 12, 2012
    10·2 answers
  • The benefits associated with AAA are increased security, increased control over the network, and the capability of auditing your
    12·1 answer
  • What do you like most about brainly?
    13·2 answers
  • The second step when using the problem-solving process is to
    7·1 answer
  • Describe the following types of data hazards. RAW WAR WAW
    13·1 answer
  • Kelvin owns a small trading firm. Recently, he suspected that some of his employees were using fraudulent activities for their p
    5·2 answers
  • An algorithm that could execute for an unknown amount of time because it depends on random numbers to exit a function may:______
    13·1 answer
  • Computer networks allow computers to send information to each other. What is the term used to describe the basic unit of data pa
    14·1 answer
  • Create a file named homework_instructions.txt using VI editor and type in it all the submission instructions from page1 of this
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!