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

Create a Python program that will produce the following output:

Engineering
1 answer:
Aloiza [94]3 years ago
6 0

Answer:

def main ():

   sentence = input("Please enter a sentence:")

   print("Original Sentence:",sentence)

   # start at the third character

   for i in range(2,  len(sentence), 3):

       # access the string by index  

       print("Every third letter:", sentence[i])

Explanation:

def helps define the sentence ( input)

in order to start printing from third letter we start the range from 2 and keep the step 3 . The range i is in square parenthesis to show the range and access string.

You might be interested in
Write a C program that will update a bank balance. A user cannot withdraw an amount ofmoney that is more than the current balanc
GarryVolchara [31]

Answer:

Explanation:

Sample output:

BANK ACCOUT PROGRAM!

----------------------------------

Enter the old balance: 1234.50

Enter the transactions now.

Enter an F for the transaction type when you are finished.

Transaction Type (D=deposit, W=withdrawal, F=finished): D

Amount: 568.34

Transaction Type (D=deposit, W=withdrawal, F=finished): W

Amount: 25.68

Transaction Type (D=deposit, W=withdrawal, F=finished): W

Amount: 167.40

Transaction Type (D=deposit, W=withdrawal, F=finished): F

Your ending balance is $1609.76

Program is ending

Code to copy:

// include the necessary header files.

#include<stdio.h>

// Definition of the function

float withdraw(float account_balance, float withdraw_amount)

{

// Calculate the balace amount.

float balance_amount = account_balance - withdraw_amount;

// Check whether the withdraw amount

// is greater than 0 or not.

if (withdraw_amount > 0 && balance_amount >= 0)

{

// Assign value.

account_balance = balance_amount;

}

// return account_balance

return account_balance;

}

// Definition of the function deposit.

float deposit(float account_balance, float deposit_amount)

{

// Check whether the deposit amount is greater than zero

if (deposit_amount > 0)

{

// Update account balance.

account_balance = account_balance + deposit_amount;

}

// return account balance.

return account_balance;

}

int main()

{

// Declare the variables.

float account_balance;

float deposit_amount;

float withdrawl_amount;

char input;

// display the statement on console.

printf("BANK ACCOUT PROGRAM!\n");

printf("----------------------------------\n");

// prompt the user to enter the old balance.

printf("Enter the old balance: ");

// Input balance

scanf("%f", &account_balance);

// Display the statement on console.

printf("Enter the transactions now.\n");

printf("Enter an F for the transaction type when you are finished.\n");

// Start the do while loop

do

{

// prompt the user to enter transaction type.

printf("Transaction Type (D=deposit, W=withdrawal, F=finished): ");

// Input type.

scanf(" %c", &input);

// Check if the input is D

if (input == 'D')

{

// Prompt the user to input amount.

printf("Amount: ");

// input amount.

scanf("%f", &deposit_amount);

// Call to the function.

account_balance=deposit(account_balance,deposit_amount);

}

// Check if the input is W

if (input == 'W')

{

printf("Amount: ");

scanf("%f", &withdrawl_amount);

// Call to the function.

account_balance = withdraw(account_balance,withdrawl_amount);

}

// Check if the input is F

if (input == 'F')

{

// Dispplay the amount.

printf("Your ending balance is $%.2f\n", account_balance);

printf("Program is ending\n");

}

// End the while loop

} while(input != 'F');

return 0;

}

the picture uploaded below shows the program screenshot.

cheers, i hope this helps.

5 0
3 years ago
Which option distinguishes the step in the engineering design phase described in the following scenario?
rewona [7]

Answer:

reasearching the problem

Explanation:

EDG

7 0
3 years ago
A conical enlargement in a vertical pipeline is 5 ft long and enlarges the pipe diameter from 12 in. to 24 in. diameter. Calcula
makkiz [27]

Answer:

F_y = 151319.01N = 15.132 KN

Explanation:

From the linear momentum equation theory, since flow is steady, the y components would be;

-V1•ρ1•V1•A1 + V2•ρ2•V2•A2 = P1•A1 - P2•A2 - F_y

We are given;

Length; L = 5ft = 1.52.

Initial diameter;d1 = 12in = 0.3m

Exit diameter; d2 = 24 in = 0.6m

Volume flow rate of water; Q2 = 10 ft³/s = 0.28 m³/s

Initial pressure;p1 = 30 psi = 206843 pa

Thus,

initial Area;A1 = π•d1²/4 = π•0.3²/4 = 0.07 m²

Exit area;A2 = π•d2²/4 = π•0.6²/4 = 0.28m²

Now, we know that volume flow rate of water is given by; Q = A•V

Thus,

At exit, Q2 = A2•V2

So, 0.28 = 0.28•V2

So,V2 = 1 m/s

When flow is incompressible, we often say that ;

Initial mass flow rate = exit mass flow rate.

Thus,

ρ1 = ρ2 = 1000 kg/m³

Density of water is 1000 kg/m³

And A1•V1 = A2•V2

So, V1 = A2•V2/A1

So, V1 = 0.28 x 1/0.07

V1 = 4 m/s

So, from initial equation of y components;

-V1•ρ1•V1•A1 + V2•ρ2•V2•A2 = P1•A1 - P2•A2 - F_y

Where F_y is vertical force of enlargement pressure and P2 = 0

Thus, making F_y the subject;

F_y = P1•A1 + V1•ρ1•V1•A1 - V2•ρ2•V2•A2

Plugging in the relevant values to get;

F_y = (206843 x 0.07) + (1² x 1000 x 0.07) - (4² x 1000 x 0.28)

F_y = 151319.01N = 15.132 KN

6 0
3 years ago
The 240-ft structure is used to provide various support services to launch vehicles prior to liftoff. In a test, a 12-ton weight
alina1380 [7]

Answer:

hello your question lacks the required question attached below is the missing diagram

Forces in GJ = -4.4444 i.e. 4.4444 tons

Forces in IG = 15.382 tons ( T )

Explanation:

Forces in GJ = -4.4444 i.e. 4.4444 tons

Forces in IG = 15.382 tons ( T )

attached below is the detailed solution

3 0
3 years ago
Find the largest number. The process of finding the maximum value (i.e., the largest of a group of values) is used frequently in
salantis [7]

Answer:

See Explanation

Explanation:

Required

- Pseudocode to determine the largest of 10 numbers

- C# program to determine the largest of 10 numbers

The pseudocode and program makes use of a 1 dimensional array to accept input for the 10 numbers;

The largest of the 10 numbers is then saved in variable Largest and printed afterwards.

Pseudocode (Number lines are used for indentation to illustrate the program flow)

1. Start:

2. Declare Number as 1 dimensional array of 10 integers

3. Initialize: counter = 0

4. Do:

4.1 Display “Enter Number ”+(counter + 1)

4.2 Accept input for Number[counter]

4.3 While counter < 10

5. Initialize: Largest = Number[0]

6. Loop: i = 0 to 10

6.1 if Largest < Number[i] Then

6.2 Largest = Number[i]

6.3 End Loop:

7. Display “The largest input is “+Largest

8. Stop

C# Program (Console)

Comments are used for explanatory purpose

using System;

namespace ConsoleApplication1

{

   class Program

   {

       static void Main(string[] args)

       {

           int[] Number = new int[10];  // Declare array of 10 elements

           //Accept Input

           int counter = 0;

           while(counter<10)

           {

               Console.WriteLine("Enter Number " + (counter + 1)+": ");

               string var = Console.ReadLine();

               Number[counter] = Convert.ToInt32(var);

               counter++;                  

           }

           //Initialize largest to first element of the array

           int Largest = Number[0];

           //Determine Largest

           for(int i=0;i<10;i++)

           {

               if(Largest < Number[i])

               {

                   Largest = Number[i];

               }

           }

           //Print Largest

           Console.WriteLine("The largest input is "+ Largest);

           Console.ReadLine();

       }

   }

}

8 0
3 years ago
Other questions:
  • Your program should read from an input file, which will contain one or more test cases. Each test case consists of one line cont
    14·1 answer
  • Which type of irrigation conserves more water than other types of irrigation?
    8·1 answer
  • What is future active and future passive and future perfect active
    9·1 answer
  • The unit weight of a soil is 14.9kN/m3. The moisture content of the soil is17% when the degree of saturation is 60%. Determine:
    15·1 answer
  • true or false incident reports, such as situation reports and status reports enhance situational awareness and ensure that perso
    12·1 answer
  • Which is the required type of fire extinguisher for standard naval vessels
    9·1 answer
  • Hi I have a question!! Please answer it ASAP, tysm!
    13·1 answer
  • Can someone please help me this is urgent!?
    12·2 answers
  • You are a planning aide on a team and are given the assignment of researching the historical significance and original blueprint
    5·1 answer
  • Subject : SCIENCE
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!