05/24/24

How Java achieve polymorphism

Java follows oops concepts so polymorphism is one of the oops concepts How Java achieve it?

04/14/23

FOR loop question in Java

You need to implement this function public int countBlocks(int levels) that takes the number of levels as an input argument and returns the number of blocks required to build a pyramid made up of... more

why do I need the type and the new keyword with the type again in Java?

When creating an object why do I need the type and the new keyword in java, for example.Scanner scan = new Scanner(System.in);it seems repetitive to say Scanner twice.

how to code in python?

Create a new class called Person. Add 3 attributes (or fields) called first_name, middle and last_name.Add a function called format_name() and return all 3 attributes.(Hint: Use the same function... more

how to code this in python?

 Create a class called Simplest() and use the pass statement.Answer the following questions:a. Using the code below, what type is this object?print(type(Simplest))b. Create an instance of Simplest... more

how to do this?

Create a new function in your functions.py script called getAnswer() that takes one numerical argument called answerNumber.use the following code inside the new getAnswer() function: if... more

how to code this and import it?

Create 2 functions; one to convert a value from Fahrenheit to celsius and the second function to convert from celsius to Fahrenheit, remember to return the values in the function statement.Create... more

01/28/23

Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents.

Code must be done in C.Output each floating-point value with two digits after the decimal point, which can be achieved as follows:printf("Amount: $%0.2lf ", dollars);Ex: If the input is: 4 3 2... more

01/25/23

dose a straw have 2 holes or dose it just have 1?

I have been conflicted by this question and it seems I never get the same answer. please help someone

indentation error

sentence = input("Enter a word:") vowel_count = 0 for i in sentence: if(i == "a" or i == "e" or i == "i" or i == "o" or i == "u"): vowel_count = vowel_count + 1 print("Total vowel count :",... more

01/19/23

A book has a weight of 13 N and is allowed to drop from a height of 19 m.

Calculate the gravitational potential energy before the book is dropped. Calculate the kinetic energy of the book when it has fallen half way to the ground. Calculate the gravitational potential... more

01/19/23

physics question

A skier weighing 82.8kg starts from rest and slides down a 32.0m frictionless slope that is inclined at an angle of 15 degrees with the horizontal. Ignore air resistance. Calculate the work done... more

How can I get it to divide decimals without it crashing

The program works fine with whole numbers, as soon as I enter a decimal like 2.5 it crashes. CLASS = str(input("What is the name of your class: "))HOURS = int(input("How many hours a week do you... more

01/16/23

Bases and value ranges

How many bytes are requires to represent the decimal number 3,175,000 in binary? How many bytes would it take to store this number?

Hex, binary, and & decimal scenario

The representation of a number using a certain base, or any base, could be very long if the number is large. Computers due to its limited storage space, always use a certain amount of space (a... more

01/08/23

Universal Gravitational

Gravity on Planet X is three times weaker than on earth. It has a radius roughly, 25% that of earths radius. What is the mass of Planet X as a percentage of earths mass?

01/05/23

Can someone help explain this to me in a simple way? And provide a sample? Thanks!

Part 1First create a single .py file that contains both the Country class definition and then a main program that uses instances of that class, similar to the way classSample.py works.  The Country... more

12/26/22

Maximum You are given N number of inputs. Print the maximum of them after each input.

Maximum You are given N number of inputs. Print the maximum of them after each input.Explanation In the example, you are given 6 inputs 1, 0, 3, 2, 9, 81 is maximum in the input 1.1 is maximum in... more

12/26/22

labelling numbers

Write a function with the name show_numbers that takes a number N and print all the numbers from 0 to N with a label to identify the even and odd numbers as shown below 0 EVEN 1 ODD 2 EVEN 3 ODD... more

12/23/22

loops arrays interation

Where is Waldo (again)With the following multi-dimensional arrayconst whereIsWaldo = [["Picard", "Riker"], "Data",["Beverly", "Guinan", "Q", "Geordi"],["Deanna", ["Worf", "Wesley"]]]; Remove Data... more

12/23/22

loops arrays interation

Where is Waldo (again)With the following multi-dimensional arrayconst whereIsWaldo = [["Picard", "Riker"], "Data",["Beverly", "Guinan", "Q", "Geordi"],["Deanna", ["Worf", "Wesley"]]]; Remove Data... more

12/23/22

Computer Science. Why doesn't this work?)

f = open("data.txt")a = 0for line in f: a = a + len(line)print(a)

Write the definition of a class named "Card" which creates a card from a standard deck of cards.

Write the definition of a class named "Card" which creates a card from a standard deck of cards. This class should have the following methods: __init__(self, rank, suit), getRank(self),... more

Two simple questions

29.What is the process called where, at execution time, the type of object to which a variable refers determines the actual method do use. 30.What keyword must a concrete class use in its... more

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.