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

Write a Python program that takes a number from the user and prints its digits from left to right.

[Consider the input number to be an INTEGER. You are not allowed to use String indexing for solving this task]

=========================================================================

Example: if the user gives 32768, then print 3, 2, 7, 6, 8


Task 11

Write a Python program which takes a number and prints the digits from the unit place, then the tenth, then hundredth, etc. (Right to Left)

[Consider the input number to be an INTEGER. You are not allowed to use String indexing for solving this task]

Example: If the user gives 32768, then print 8, 6, 7, 2, 3


First, read in an input value for variable numVals. Then, read numVals integers from input and output each on the same line with the character ", " between each value. End with a newline. 

Note: ", " should not be at the beginning or end of the output.

Ex: If the input is 4 -60 -35 -15 -45, the output is:

-60, -35, -15, -45


Implement a c# method CalculateCourseFee(double courseFee, double marks, double serviceFee) to calculate the total fees to be paid by a student.



The students are entitled to get scholarship based on the marks scored in the qualifying exam. Scholarship percentage should be considered as half of the marks scored by the student on the course fee. Apart from the course fee(after deducting the scholarship amount), the students have to pay extra service fees.



Assume that the marks is out of 100 and need not always be integer.

Write a python function that accepts a list of numbers and try to find out the value of a ‘magic index’. The ‘magic index’ is calculated as the ratio of the largest and smallest list element. The python function Magic_Index(A) Take a list of elements and return the value of the magic index or error message for any possible exceptions. The error message will be "error occurred = error name".


 

Example-1

Example-2

 Example-3

Input:

[1, 2, 0]

 

Output:

Division Error: division by zero

Input:

[1, 2, 3, 6]

 

Output:

6.0

Input:

[1, 2, 0, "x"]

 

Output:

Other Error: '>' not supported between instances of 'str' and 'int'



Write a FaceConnect program that has the ff module:

  • script module that'll let the user enter password and username, if username is "X" or "x", program will exit. if username and password are correct, a welcome message and the menu will be displayed. Otherwise, prompt for username and password again. program must perform view, add or delete friend function depend on input.
  • a myLogin module that retrieves the information of the user given username and password.
  • a manageData module that will allow the retrieval, adding and deleting of friend(s).


NOTE: ALL info must be saved in text files.

The ff are the textfiles:


userCredentials - where the data of registered users will be written.

Format:

username;password;firstname;lastname;birthdate

e.g

prettyME;1234;Rhea;Tortor;12/25/1990


Each user has its own textfile where his/her friend(s) info will be written. use the username as the filename of each file.


The content of each file follow below format:


username1;[username2];[username3];


A company is offering a special discount to its customers based on an algorithm. Two range values are fed to the algorithm and in return t will calculate the discount to offer to the customers. The discount is calculated as the sum of all the prime numbers within the defined range including the range values if the range values are the prime numbers










Write an algorithm to find the special discount given to the customers










Input










The first line of the input consists of










an integer-rangelet remeng










the minimum boundary wabererte










given range

Write a program to test your

class. Use integer variables to represent the private instance variables of the class—the numerator and

the denominator. Provide a constructor that enables an object of this class to be initialized when it’s

declared. The constructor should store the fraction in reduced form. The fraction:

2/4 is equivalent to 1/2 and would be stored in the object as 1 in the numerator and 2 in the denominator.

Provide a no-argument constructor with default values in case no initializers are provided. Provide public

methods that perform each of the following operations:

Add two Rational numbers: The result of the addition should be stored in reduced form.

Subtract two Rational numbers: The result of the subtraction should be stored in reduced form.

Multiply two Rational numbers: The result of the multiplication should be stored in reduced

form.

Also, write a test program to test all methods, and provide the UML class diagram of your class.


Create class SavingsAccount. Use a static variable annualInterestRate to store the annual

interest rate for all account holders. Each object of the class contains a private instance variable

savingsBalance indicating the amount the saver currently has on deposit. Provide method

calculateMonthlyInterest to calculate the monthly interest by multiplying the

savingsBalance by annualInterestRate divided by 12—this interest should be added to

savingsBalance. Provide a method modifyInterestRate that sets the

annualInterestRate to a new value.

Write a program to test class SavingsAccount. Instantiate two savingsAccount objects, saver1

and saver2, with balances of $2000.00 and $3000.00, respectively. Set annualInterestRate to

4%, then calculate the monthly interest for each of 12 months and print the new balances for both savers.

Next, set the annualInterestRate to 5%, calculate the next month’s interest and print the new

balances for both savers. Also, provide the UML class diagram of your class.


Find perimeter of a matrix


Input1:


1 2 3


4 5 6


7 8 9


Output: 40


Input2:


1 2 3 4


5 6 7 8


9 10 11 12


13 14 15 16


Output: 102

LATEST TUTORIALS
APPROVED BY CLIENTS