answer.
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
Bad White [126]
1 year ago
10

The height of a small rocket y can be calculated as a function of time after blastoff with the following piecewise function: y 5

38.1454t 1 0.13743t 3 0 # t , 15 y 5 1036 1 130.909(t 2 15) 1 6.18425(t 2 15)2 2 0.428(t 2 15)3 15 # t , 33 y 5 2900262.468(t 233)216.9274(t 233)2 1 0.41796(t 233)3 t . 33 Develop a well-structured pseudocode function to compute y as a function of t. Note that if the user enters a negative value of t or if the rocket has hit the ground (y # 0) then return a value of zero for y. Also, the function should be invoked in the calling program as height(t). Write the algorithm as (a) pseudocode, or (b) in the high-level language of your choice.
Computers and Technology
1 answer:
SOVA2 [1]1 year ago
5 0

Answer:

High level Language

understand

Explanation:

rocket is 0...4433456u888

You might be interested in
JAVA Write a program that first asks the user to type a letter grade and then translates the letter grade into a number grade. L
ale4655 [162]

Answer:

Follows are the code to this question:

import java.util.*;//import package for user input

class GradePrinter//defining class GradePrinter

{

double numericValue = 0;//defining double variable

String grade = "";//defining String variable

GradePrinter()//defining default constructor  

{

Scanner xb = new Scanner(System. in );//defining Scanner  class object

System.out.print("Enter Grade: ");//print message

grade = xb.nextLine();//input string value  

}

double getNumericGrade()//defining double method getNumericGrade

{

if (grade.equals("A+") || grade.equals("A"))//defining if block that check input is A+ or A

{

numericValue = 4.0;//using  numericValue variable that hold float value 4.0

}

else if (grade.equals("A-"))//defining else if that check grade equals to A-

{

numericValue = 3.7;//using  numericValue variable that hold float value 3.7

}

else if (grade.equals("B+"))//defining else if that check grade equals to B-

{

numericValue = 3.3;//using  numericValue variable that hold float value 3.3

}

else if (grade.equals("B"))//defining else if that check grade equals to B

{

numericValue = 3.0;//using  numericValue variable that hold float value 3.0

}

else if (grade.equals("B-"))//defining else if that check grade equals to B-  

{

numericValue = 2.7;//using  numericValue variable that hold float value 2.7

}

else if (grade.equals("C+"))//defining else if that check grade equals to C+  

{

numericValue = 2.3; //using  numericValue variable that hold float value 2.3

}

else if (grade.equals("C")) //defining else if that check grade equals to C  

{

numericValue = 2.0; //using numericValue variable that hold float value 2.0

}

else if (grade.equals("C-")) //defining else if that check grade equals to C-  

{

numericValue = 1.7;//using umericValue variable that hold float value 1.7

}

else if (grade.equals("D+"))//defining else if that check grade equals to D+  

{

numericValue = 1.3;//using umericValue variable that hold float value 1.3

}

else if (grade.equals("D"))//defining else if that check grade equals to D

{

numericValue = 1.0;//using umericValue variable that hold float value 1.0

}

else if (grade.equals("F"))//defining else if that check grade equals to F

{

numericValue = 0;//using umericValue variable that hold value 0

}

else//defining else block

{

System.out.println("Letter not in grading system");//print message

}

return numericValue;//return numericValue

}

}

class Main//defining a class main

{

public static void main(String[] args)//defining main method

{

GradePrinter ob = new GradePrinter();// creating class GradePrinter object

double numericGrade = ob.getNumericGrade();//defining double variable numericGrade that holds method Value

System.out.println("Numeric Value: "+numericGrade); //print Value numericgrade.

}

}

Output:

Enter Grade: B

Numeric Value: 3.0

Explanation:

In the above-given code, a class "GradePrinter" is defined inside the class a string, and double variable "grade and numericValue" is defined, in which the grade variable is used for input string value from the user end.

After input, the sting value a method getNumericGrade is defined, which uses multiple conditional statements is used, which holds double value in the which is defined in the question.

In the main class, the "GradePrinter" object is created and defines a double variable "numericGrade", that calling method and store its value, and also use print method to print its value.

4 0
1 year ago
A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a fi
victus00 [196]

Answer:

I am writing a Python program.

def concordance(filename):  # function that takes a file name as parameter and returns the concordance for that file

   file = open(filename,"r")  #opens file in read mode

   unique={}  #creates and empty list

   for word in file.read().split():  #loops through every word in the file

       if word in unique:  # if words is already present in the list

           unique[word] += 1  #add 1 to the count of the existing word

       else:    #if word is not present in the list

           unique[word] = 1 #add the word to the list and add 1 to the count of word

           file.close();  # close the file

   for x in sorted(unique):  #sort the list and displays words with frequencies

       print(x, unique[x]);  #prints the unique words and their frequencies in alphabetical order

#prompts user to enter the name of the file

file_name=input('Enter the input file name: ')

concordance(file_name)  #calls concordance method by passing file name to it

Explanation:

The program has a function concordance that takes a text file name as parameter and returns a list of unique words and their frequencies.

The program first uses open() method to open the file in read mode. Here "r" represents the mode. Then creates an empty list named unique. Then the for loop iterates through each word in the file. Here the method read() is used to read the contents of file and split() is used to return these contents as a list of strings. The if condition inside the loop body checks each word if it is already present in the list unique. If the word is present then it adds 1 to the count of that word and if the word is not already present then it adds that unique word to the list and assign 1 as a count to that word. close() method then closes the file. The second for loop for x in sorted(unique):  is used to display the list of unique words with their frequencies. sorted() method is used to sort the list and then the loop iterates through each word in the list, through x, which acts like an index variable, and the loop displays each word along with its frequency.

6 0
1 year ago
Stan’s assignment is to print a three-dimensional image on a piece of paper. Which printing technique should he use?
Zigmanuir [339]

Answer:

to print a three-dimensional image on a piece of paper he should use autocad

8 0
1 year ago
Read 2 more answers
BlockPy: #35.2) Animal Splits Write a function all_cats that consumes a comma-separated string of animals and prints whether all
maks197457 [2]

Answer:

def all_cats(data):

 dataArray = data.split(',')

 if(data==""):

   return True

 for i in dataArray:

   if('cat' not in i):

     return False

 

 return True

print(all_cats("gerbil,catfish,dog,cat"))

print(all_cats("cat,catfish"))

print(all_cats(""))

Explanation:

Step 1: define de function and the parameters

def all_cats(data):

Step 2: split the data by ,

dataArray = data.split(',')

Step 3 : validate if is an empty data and return true

if(data==""):

   return True

Step 4: Loop over de array data and validate if have cat in each data if not, then return false

for i in dataArray:

   if('cat' not in i):

     return False

Step 5 if have cat in each one return true

return True

Step 6 Validate with examples

print(all_cats("gerbil,catfish,dog,cat"))

print(all_cats("cat,catfish"))

print(all_cats(""))

6 0
1 year ago
You are responsible for a rail convoy of goods consisting of several boxcars. You start the train and after a few minutes you re
maks197457 [2]

Answer:

The program in C++ is as follows:

#include <iostream>

#include <iomanip>

using namespace std;

int main(){

   int cars;

   cin>>cars;

   double weights[cars];

   double total = 0;

   for(int i = 0; i<cars;i++){

       cin>>weights[i];

       total+=weights[i];    }

   double avg = total/cars;

   for(int i = 0; i<cars;i++){

       cout<<fixed<<setprecision(1)<<avg-weights[i]<<endl;    }

   return 0;

}

Explanation:

This declares the number of cars as integers

   int cars;

This gets input for the number of cars

   cin>>cars;

This declares the weight of the cars as an array of double datatype

   double weights[cars];

This initializes the total weights to 0

   double total = 0;

This iterates through the number of cars

   for(int i = 0; i<cars;i++){

This gets input for each weight

       cin>>weights[i];

This adds up the total weight

       total+=weights[i];    }

This calculates the average weights

   double avg = total/cars;

This iterates through the number of cars

   for(int i = 0; i<cars;i++){

This prints how much weight to be added or subtracted

       cout<<fixed<<setprecision(1)<<avg-weights[i]<<endl;    }

4 0
1 year ago
Other questions:
  • Two career fields that lack minority professionals and thus offer many grant opportunities to students are education and _____.
    10·2 answers
  • A(n) ______close to a cover letter leads to more interviews because you are contacting the employer. a. passive b. lengthy c. ac
    11·2 answers
  • Which key retains its uniqueness even after you remove some of the fields?
    14·1 answer
  • Jane's organization recently experienced a security incident that occurred when malware set to trigger on the chief executive of
    13·1 answer
  • If byte stuffing is used to transmit Data, what is the byte sequence of the frame (including framing characters)? Format answer
    6·1 answer
  • Which of the following sorting algorithms is described by this text? "Take the item at index 1 and see if it is in order compare
    10·1 answer
  • A company with a large number of hosts creates three subdomains under a main domain. For easier management of the host records,
    11·1 answer
  • Let's revisit our lucky_number function. We want to change it, so that instead of printing the message, it returns the message.
    10·1 answer
  • What is the average number of nodes accessed in search for a particular element in an unordered list? In an ordered list? In an
    6·1 answer
  • How to code 2.9.5: Four colored triangles {Code HS}
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!