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
frez [133]
2 years ago
11

3.5 Code Practice

Computers and Technology
2 answers:
Veseljchak [2.6K]2 years ago
7 0

Answer:

grade = input("Enter grade")

def add(grade):

if grade == 9:

 print("Not in High School Freshman")

elif grade == 10:

 print("In High School")

 print("somophone")

elif grade == 11:

 print("in High School")

 print("Junior")

elif grade == 12:

 print("in High School")

 print("Senior")

else:

 print("Grade Not Accepted:")

return 0;

add(11)

Output:

Enter grade 11

in High School

Junior

Process finished with exit code 0

Explanation:

Firstly remember that this is a function, and not a program. Hence, you need to call the function to test it. A python program is interpreted line by line, Hence, we can test a function as well. Here we input a grade, and through the function find the details related to it and the print it out, which is clearly explained through the definition of the function.

Veronika [31]2 years ago
3 0

Answer:

Python.

Explanation:

grade_number = input("What grade are you in? ")

/////////////////////////////////////////////////////////////////////

// Using if else control statements to print the right student level

if grade_number == 9:

   print("Freshman")

elif grade_number == 10:

   print("Sophomore")

elif grade_number == 11:

   print("Junior")

elif grade_number == 12:        

    print("Senior")

else:

    print("Not in High School")

You might be interested in
The attack in which the attacker sends a forged packet with the same source IP address and destination IP address in which the v
Sergeeva-Olga [200]

Answer:

TEARDROP

Explanation:

Teardrop is a form of attack in which the attacker sends a forged packet with the same source IP address and destination IP address in which the victim may be tricked into sending messages to and from itself .

Teardrop attack also involves sending fragmented packets to a target machine in which the victim is been tricked into sending messages to and from itself. One of the fields in an IP header is the “fragment offset” field, indicating the starting position of the data contained in a fragmented packet relative to the data in the original packet.

7 0
2 years ago
Write a boolean method that checks whether a given positive integer n is a perfect square. Use Math’s sqrt and round methods to
svetoff [14.1K]
In java...

public boolean checkSquare(int n){

int actualNumber = n;
int squareRoot = (int)Math.sqrt(n);
int squaredNumber = Math.pow(squareRoot,2);

if(squaredNumber==actualNumber){
return true;
} else {
return false;
}

}
5 0
2 years ago
Using python,
Levart [38]

Answer:

Explanation:

We can use for-loop in python to calculate the tuition amount in the next 5 years. If the tuition is increasing 3% each year, in each loop we can multiply the amount by 1.03

tuition = 8000

for year in range(1,6):

    tuition *= 1.03

    print("The tuition amount after " + str(year) + " year(s) is $" + str(tuition))

4 0
2 years ago
A blood bank maintains two tables - DONOR, with information about people who are willing to donate blood and ACCEPTOR, with info
Kipish [7]

Answer:

The sql query is given below.

Since we need to count of males and females for a particular blood group, we put xxx for the blood group.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors,

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

Explanation:

The clauses in the query are as follows.

1. SELECT: all the columns required in the output are put in this clause.

2. FROM JOIN ON: the table(s) from which the above columns are taken are put in this clause.

3. WHERE: any condition required to filter the output is put in this clause.

The query is explained below.

1. Find the number of male donors. Number of anything can be found using COUNT() function. A query is required since gender is included in deciding the type of donor.

2. The query is defined to find number of male donors as follows.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "M%"; )

3. In the previous query, LIKE operator is used since it is not defined what value is stored for male donors.

4. Similarly, the query to find the number of female donors is formed.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "F%"; )

5. Next, the final query is formed as follows.

SELECT: both COUNT() functions will come here.

FROM: table name

WHERE: specific blood group will be put here

GROUP BY: this clause is optional and is not used in this query.

HAVING: this clause is optional and is not used in this query.

6. The query after putting all clauses is shown below.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%"),

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%")

FROM DONOR

WHERE BG = xxx;

7. Alias is used in the above query for each column to get the final query.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors, COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

7 0
2 years ago
Write an if-else statement to describe an integer. Print "Positive even number" if isEven and is Positive are both true. Print "
Nina [5.8K]

Answer:

C code explained below

Explanation:

#include <stdio.h>

#include <stdbool.h>

int main(void) {

int userNum;

bool isPositive;

bool isEven;

scanf("%d", &userNum);

isPositive = (userNum > 0);

isEven = ((userNum % 2) == 0);

if(isPositive && isEven){

  printf("Positive even number");

}

else if(isPositive && !isEven){

  printf("Positive number");

}

else{

  printf("Not a positive number");

}

printf("\n");

return 0;

}

6 0
2 years ago
Other questions:
  • Which Android application is used exclusively for sharing video content?
    12·2 answers
  • You are attempting to open a file containing a list of integer numbers, each on a separate line, and read them into Python as in
    6·1 answer
  • Explain why Windows and Linux implements multiple locking mechanisms. Describe the circumstances under which they use spinlocks,
    13·1 answer
  • (1) Output a menu of automotive services and the corresponding cost of each service. (2 pts) Ex: Davy's auto shop services Oil c
    15·1 answer
  • You have been employed as a technical consultant to a computer shop chain. You are given the task of creating a short consumer b
    12·1 answer
  • The properly marked source document states: (C) Operation Panda will take place on 29 September. The new document states: (C) On
    8·1 answer
  • In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the mont
    14·1 answer
  • [20 points] 3.3 Code Practice: Question 2
    7·1 answer
  • Which of the following are true statements about the data that can be represented using binary sequences?
    5·1 answer
  • The program DebugTwo2.cs has syntax and/or logical errors. Determine the problem(s) and fix the program.// This program greets t
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!