Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Answer to Question #341372 in Python



Note:Error is displaying in this code, please correct it

Enter the number of societies:Keep the number of people in societies:

Traceback (most recent call last):

 File "main.py", line 4, in <module>

  num_people = int(input('Keep the number of people in societies:'))

ValueError: invalid literal for int() with base 10: '\r'


Create an application that calculates your daily driving cost, so that you can estimate how much money could be saved by carpooling, which also has other advantages such as reducing carbon emissions and reducing traffic congestion. The application should input the following information and display the user’s cost per day of driving to work: 

a) Total miles driven per day. 

b) Cost per gallon of gasoline. 

c) Average miles per gallon.

d) Parking fees per day. 

e) Tolls per day.


A window with the title “Welcome Home”

What is the output of the following code?


int x = 100;


int y = 200;



if (x > 100 && y <= 200)


System.out.println(x + “ “ + y + “ “ + (x + y));


else


System.out.println(x + “ “ + y + “ “ + (2 * x - y));

Declare the Person superclass as abstract. Add this abstract method to the class:

public abstract void eat(String food);

Both the Student and Employee class inherit from abstract superclass Person, and provides an implementation for eat() which displays that the student or employee is eating a certain food.

(Note what happens if you don’t implement eat().)



Create an interface called StudentInterface. This interface has the following abstract method:

public void study(String subject);

The Student class implements this interface, and provides an implementation for study() which displays that the student is studying a certain subject.

(Note what happens if you don’t implement study().)


Write a program in Python programming language, which allows the user to input an integer value. Based on the input values, the program should perform the following tasks:


⦁ If the entered value is negative then it should print “Factorial does not exist for negative numbers”.

⦁ If the entered value is 0 then it should print “The factorial of 0 is 1”.

⦁ Calculate and display the factorial of the given integer.



Write a program in Python programming language, which allows the user to input a number and upper limit, and based on the input values, the program should perform the following tasks:

⦁ Check whether the value entered by the user is a positive integer.

⦁ Generates an error massage in case of negative integer.

⦁ Generate a table of given number.

⦁ Upper limit for table will be get from user.



One box have some apples and another box have some oranges, develop a C++ program to find the sum of fruits and double the sum of fruits in the box using call by address concept

Create an array of size 12. Swap values of 8th and 11th index and display the changed array on screen.

LATEST TUTORIALS
APPROVED BY CLIENTS