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
lara [203]
3 years ago
9

Edhesive 3.5 code practice quetion one

Computers and Technology
1 answer:
sleet_krkn [62]3 years ago
6 0

Answer:

x = int(input("What grade are you in? "))

if (x == 9):

   print("Freshman")

elif (x == 10):

   print("Sophomore")

elif (x == 11):

   print("Junior")

elif (x == 12):

   print("Senior")

else:

   print("Not in High School")

Explanation:

Hope this helps lovely :)

You might be interested in
PYTHON
Nina [5.8K]

Answer:

This is one of the efficient ways to find the number of occurrences of a given number in a list:

<h3><u>def find_num(arr,n):</u></h3><h3><u>    return len([count for count in arr if count == n])</u></h3><h3><u>print(find_num([0,1,1,1,0],1))</u></h3>

If you want a simpler version, you can try this:

<h2><u>def find_num(arr,n):</u></h2><h2><u>    count = 0 </u></h2><h2><u>    for i in range(len(arr)): </u></h2><h2><u>        if arr[i]==n: </u></h2><h2><u>            count += 1 </u></h2><h2><u>    return count</u></h2><h2><u>print(find_num([0,1,1,1,0],1))</u></h2>

This is the simplest method:

<h2><u>arr = [0,1,1,1,0]</u></h2><h2><u>print(arr.count(1))</u></h2>

I think I gave you enough examples. This should get you started off easily.

If you need an explanation, I am happy to help you. BTW I started python 6 months back so even I am pretty new to this.

4 0
3 years ago
How can I write an assignment statement that stores the character 'X' in a variable ch?
Gre4nikov [31]

Answer:

In C++ we can assign a character to the variable by using the below statement.

ch='X';

Explanation:

The complete program for assigning a character to the variable is given as

#include<iostream>

#include <conio.h>

using namespace std;

main()

{

char ch;

ch= 'X';

cout<<"output of variable Ch ="<<ch;

getch();

}

In above program Char is the data type used for character type variables. ch= 'X' stores X in ch. Then output will shown through cout.

5 0
4 years ago
Write pseudocode instructions to carry out each of the following computational operations:1. Determine the area of a triangle gi
Zinaida [17]

Answer:

Hi there! The question is checking your knowledge on Pseudocode. Pseudocode is a high level solution written in plain English to outline the steps needed for the program to work correctly. An implementation for the different parts of the question is written below.

Explanation:

1. Determine the area of a triangle

  declare formula for area calculation of triangle as ½ * (base * height)

  validate input parameters “base” and “height”

  apply formula and return result

2. Compute the interest earned Prompt user for input 2

   declare formula for interest calculation as annual interest rate * term *     starting account balance

   validate input parameters “interest_rate” and “starting_account_balance ”

   apply formula and return result as final balance at the end of the year as the interest earned + starting balance.

3. Determine the flying time between two cities given the mileage M between them and the average speed of the airplane.

   declare formula for time calculation of triangle as time = distance / speed

   validate input parameters for mileage “M” and speed “S”

   apply formula and return result

7 0
3 years ago
What are workplace human relations
snow_lady [41]

Answer:

Relationships between employees and management are of substantial value in any workplace. Human relations is the process of training employees, addressing their needs, fostering a workplace culture and resolving conflicts between different employees or between employees and management.

3 0
3 years ago
Write a program that accepts an integer value called multiplier as user input. Create an array of integers with ARRAY_SIZE eleme
Tasya [4]

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

void PrintForward(int myarray[], int size){

   for(int i = 0; i<size;i++){        cout<<myarray[i]<<" ";    }

}

void PrintBackward(int myarray[], int size){

   for(int i = size-1; i>=0;i--){        cout<<myarray[i]<<" ";    }

}

int main(){

   const int ARRAY_SIZE = 12;

   int multiplier;

   cout<<"Multiplier: ";

   cin>>multiplier;

   int myarray [ARRAY_SIZE];

   for(int i = 0; i<ARRAY_SIZE;i++){        myarray[i] = i * multiplier;    }

   PrintForward(myarray,ARRAY_SIZE);

   PrintBackward(myarray,ARRAY_SIZE);

   return 0;}

Explanation:

The PrintForward function begins here

void PrintForward(int myarray[], int size){

This iterates through the array in ascending order and print each array element

<em>    for(int i = 0; i<size;i++){        cout<<myarray[i]<<" ";    }</em>

}

The PrintBackward function begins here

void PrintBackward(int myarray[], int size){

This iterates through the array in descending order and print each array element

<em>    for(int i = size-1; i>=0;i--){        cout<<myarray[i]<<" ";    }</em>

}

The main begins here

int main(){

This declares and initializes the array size

   const int ARRAY_SIZE = 12;

This declares the multiplier as an integer

   int multiplier;

This gets input for the multiplier

   cout<<"Multiplier: ";    cin>>multiplier;

This declares the array

   int myarray [ARRAY_SIZE];

This iterates through the array and populate the array by i * multiplier

<em>    for(int i = 0; i<ARRAY_SIZE;i++){        myarray[i] = i * multiplier;    }</em>

This calls the PrintForward method

   PrintForward(myarray,ARRAY_SIZE);

This calls the PrintBackward method

   PrintBackward(myarray,ARRAY_SIZE);

   return 0;}

6 0
3 years ago
Other questions:
  • Like Tess, Brina has a fascinating job! She works as a software engineer with Instagram. She says that Computer Science is a way
    10·2 answers
  • Alicia would like to make important text in her spreadsheet stand out. Alicia should _____
    8·2 answers
  • Do you think that people have a “right” to remain anonymous online? Why or why not?
    6·1 answer
  • What is the output of the following program segment? int main() { int num = 5; cout &lt;&lt; num &lt;&lt;" "; change(num); cout
    8·1 answer
  • True or false? pressing Ctrl and S is a shortcut for saving
    15·2 answers
  • Fill in the blank: _________ is Google’s machine-learning artificial intelligence system that interprets people’s searches to fi
    9·1 answer
  • Write a recursive function that returns 1 if an array of size n is in sorted order and 0 otherwise. Note: If array a stores 3, 6
    6·1 answer
  • Import java.util.ArrayList;
    14·1 answer
  • Can someone pls help with this (20 points)
    8·1 answer
  • Convert Octal 623, to Decimal number ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!