The function changeLocation is also called a _____.class bike:
def __init__(self,size,idNum,color ):
self.size = size
self.location = 10
self.color = color
self.idNum = idNum

def changeLocation(self,newLocation):
self.location = newLocation


manipulator

initiator

method

constructor

Answers

Answer 1
Answer:

Answer:

The answer is a method

Explanation:

Answer 2
Answer:

Answer:

class and self

Explanation:

class Bike:

def __init__(self, str, float):

self.color = str

self.price = float


Related Questions

Is printer an input device​
1. (1 pt) Suppose you wish to run a program P with 37.5 x 109instructions on a 15 GHz machine with a CPI of 0.75. What is the expected CPU time to execute this program on this machine
Which best describes what online reading tools aim to help readers do? *100 POINTS*
Which feature in Access is used to control data entry into database tables to help ensure consistency and reduce errors?O subroutinesO searchO formsO queries
In confirmatory visualization Group of answer choices Users expect to see a certain pattern in the data Users confirm the quality of data visualization Users don't know what they are looking for Users typically look for anomaly in the data

Write structured pseudocode to show the following: when you are on time for work you have time to buy coffee

Answers

Answer:

If( on_time == True) {

     print("Coffee")

} else {

    print("No Coffee")

}

Explanation:

Step 1 evaluate with a boolean variable if you are on time

If( on_time == True) {

Step 2 if true you have coffee

print("Coffee")

Step 3 if false you have not coffee

print("No Coffee")

Write a program that reads an integer and displays, using asterisks a filled and hollow square, placed next to each other. for example if side length is 5 the program should display like so.This program prints a filled and hollow square.
Enter the length of a side: 5
***** *****
***** * *
***** * *
***** * *
***** *****

Answers

Answer:

Here is the JAVA program.

import java.util.Scanner; //Scanner class to take input from user

 public class HollowFilledSquare {

          public static void main(String[] args) { //start of main() function body

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

          System.out.print("Enter an integer to display a filled and hollow square "); //prompts user to enter an integer

           int n = sc.nextInt(); // reads integer input from the user

          StringBuilder filled = new StringBuilder(n);

// creates objects filled and hollow of class StringBuilder

          StringBuilder hollow = new StringBuilder(n);

          for (int i = 1; i <= n; i++) { // outer loop for length of the square

              for (int j = 1; j <= n; j++) { // inner loop for width of square

                  filled.append("*"); //displays asterisks

                    if (i == 1 || i == n || j == 1 || j == n) // condition to display stars

                       {hollow.append("*");}

                   else

                     {  hollow.append(" ");  }             } // to display empty spaces

           System.out.println(filled + "   " + hollow);

// places hollow and filled squares next to each other

           filled. delete(0, filled.length());  

//removes characters from 0 to the length of filled square

           hollow. delete(0, hollow.length());      

//removes characters from 0 to the length of hollow square } }  }

Explanation:

The program first prompts the user to enter an integer. It uses outer loop for length of the square and inner loop for width of square in order to display the asterisks. append () function is used to display the sequence of asterisks. delete () function removes the  asterisks from the sequence of asterisks. String Builder is a class used for to create a string of n characters. It basically works like String but this is used to create modifiable objects.

The screen shot of the code along with the output is attached.

Final answer:

A Python program can be written to read an integer that is then used to print out two squares of that side length with asterisks, one filled and one hollow. The provided Python code uses nested loops and conditionals to generate the squares accurately.

Explanation:

To complete your request, we would need to write a program to read an integer input and utilize this integer value to generate two squares with asterisks, one filled and one hollow. Here is a simple Python program:

def print_squares(n):
# Full square
for i in range(n):
 for j in range(n):
  print('*', end=' ')
 print()

# New line between squares
print()

# Hollow square
for i in range(n):
 for j in range(n):
  if i==0 or i==n-1 or j==0 or j==n-1:
   print('*', end=' ')
  else:
   print(' ', end=' ')
 print()

# Run the function
print_squares(int(input('Enter the length of a side: ')))

This program first prints a filled square and a hollow square using conditionals to distinguish between the edge and inner positions of the squares.

Learn more about Python programming here:

brainly.com/question/33469770

#SPJ3

To return the value of the cell D8, the formula should be OFFSETA1=________.

Answers

Answer:

The formula is =OFFSET( A1, 7,3,1,1 )

Explanation:

Microsoft excel is a statistical and analytical tool for data management and analysis. Its working environment is called a worksheet. The worksheets are made up of rows and columns also known as records and fields respectively.

Functions like OFFSET in excel is used to return a cell or group of cells. It gets the position to turn by start getting a starting port, then the number of records below it and the fields after, then the length and width of cells to return.

syntax:   =OFFSET( "starting cell", "number of rows below", "number of columns after", "height of cells to return", "width of cells to return" )

When do you need to apply for program completion andreview?a. 1-2 semesters before program completion

b. one month before program completion

c. a couple of weeks before program completion

d.Never, you don’t need to complete any paperwork to prepare for program completion

Answers

Answer:

d. Never, you don’t need to complete any paperwork to prepare for program completion

Explanation:

Program completion is depends on completion of your course work and successful thesis defense. If all the requirements to complete the program are successfully completed with required grades university/ Institute will automatically  complete your program. In case you have any requirement left or any course having grade 'F' your program will not be considered as completed. In case if you want to improve some grade or revise some course you should write to the university that you want improve some course or grade.

So, there is no need to complete any paper work to prepare for program completion.

The energy company in Program 1 now uses different rates for residential and business customers. Residential customers pay $0.12 per kWh for the first 500 kWh. After the first 500 kWh, the rate is $0.15 per kWh. Business customers pay $0.16 per kWh for the first 800 kWh. After the first 800 kWh, the rate is $0.20 per kWh. Write a program to calculate energy charge. You must write and use the following two functions. (a)A main function: Ask the user to enter number of kWh used and customer type (enter R for residential or B for business). Call the bill_calculator function and pass number of kWh used and customer type to it as arguments. You must use positional arguments to pass kWh used and customer type. (b)A bill_calculator function: This function has two parameters to receive number of kWh used and customer type. Calculate and display the energy charge.

Answers

Answer:

The c# program for the scenario is given below.

using System;

public class Program2 {

 double total = 0;

 static void Main() {

     Program2 ob = new Program2();

   Console.WriteLine("Enter total energy used in kilo watts ");

   int p;

   p = Convert.ToInt32(Console.ReadLine());

   Console.WriteLine("Enter type of customer ");

   char t;

   t = Convert.ToChar(Console.ReadLine());

   ob.bill_calculator(p, t);

   Console.WriteLine("Total charge for " + p + " kilo watts electricity for " + t + " customers is " + ob.total);

 }

 public void bill_calculator(int e, char c)

 {

     int first=500, second = 800;

     double chg_one = 0.12, chg_two=0.15, chg_three = 0.16, chg_four = 0.20;

     if(c == 'R')

     {

        if(e <= 500)

        {      

            total = (e * chg_one);

        }

        else if(e > 500)

        {

           total = ( first * chg_one);

           total = total + ((e-first) * chg_two);

        }

     }

     if(c == 'B')

     {

        if(e <= 800)

        {      

          total = (e * chg_three);

        }

        else if(e > 800)

        {

          total = ( first * chg_three);

          total = total + ((e-second) * chg_four);

        }

     }

  }

}

OUTPUT

Enter total energy used in kilo watts                                                                                                            

1111                                                                                                                                            

Enter type of customer                                                                                                                          

B                                                                                                                                                

Total charge for 1111 kilo watts electricity for B customers is 142.2

Explanation:

The program takes user input for the type of customer and the amount of electric current used by that customer.

The two input values decide the rate at which total charge is calculated.

For residential customers, charges are divided into slabs of 500 or less and more than 500.

Alternatively, for business customers, charges are divided into slabs of 800 or less and more than 800.

User input is taken in main function.

Charges are calculated in the bill_calculator method which takes both user input as parameters.

If else block is used to calculate the charges.

No input validation is implemented as it is not mentioned in the question.

All code is written inside the class. An object is created of the class.

The methods outside main() are called using the object of the class.

If you have a list consisting of just numbers, then you can add all of the values in the list using the sum() function. If your list consists of some numbers and some values of other types (e.g., lists, strings, sets), the sum() function will fail. In this question, we're asking you to write a function that will sum all of the numbers in a list, ignoring the non-numbers. The function below takes one parameter: a list of values (value_list) of various types.


The recommended approach for this:

(1) create a variable to hold the current sum and initialize it to zero,

(2) use a for loop to process each element of the list,

(3) test each element to see if it is an integer or a float, and, if so, add its value to the current sum,

(4) return the sum at the end.


student.py 1


Hef sum_lengths(value_list):

# Implement your function here. Be sure to indent your code block! Restore original file

Answers

Answer:

See explaination

Explanation:

def sum_lengths(value_list):

total = 0

for x in value_list:

if (type(x)==int) or (type(x)==float):

total += x

return total