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

1. Binary Search

by CodeChum Admin

Searching is one very important Computer Science task. When you have a list, searching is natural. You would want to search for an item in the list. If the list is not sorted, there is no way to it but do a linear search - check each element until the item is found or until there are no elements left to inspect.


More info here, Important!

https://pastebin.com/eZWPNhh9


2. More Shapes

by CodeChum Admin

Since we are interested with drawing in this quiz (it seems), consider a Shape object. We know that for regular shapes (like Rectangle and Circle), they have properties like area and perimeter. Let's also assume that these Shapes have color (simply a String for the purpose of this quiz) and whether the shapes are filled with this color or not (boolean).


More info here, Important!

https://pastebin.com/hFgYeMFH


You probably are fond of games. This quiz though is not that complicated. You are simply going to work with a point on a screen, and a circle on a screen as well. And let's consider them as the characters in the game. We are going to call both of these characters as Movable objects. Objects are said to be Movable if they can be moved around the screen. The following simple movements are allowed:


public void moveLeft();
public void moveRight();
public void moveUp();
public void moveDown(); 
public void display();
public void moveLeft();
public void moveRight();
public void moveUp(); 
public void moveDown();
public void display();


Input

- 1 moveLeft()

- 2 moveRight()

- 3 moveUp()

- 4 moveDown()

1
0·0
5
4
4
2
2
1


Output

A single line simply printing the string returned by toString().

Point:·(1,2)


More info here, Important!

pastebin.com/05W0gkTx




Write the Python code of a program that reads a student’s mark for a single subject, and prints out the corresponding grade for that mark. The mark ranges and corresponding grades are shown in the table below. You need to make sure that the mark is valid. For example, a student cannot receive -5 or 110 marks. So, the valid marks range is 0 to 100.

A teacher has taken exam of his students. He has stored marks in a dictionary where keys are the student's name and values are student's marks. Now he wants to know the name of students obtained minimum and maximum marks from this dictionary. You need to write a python function F-m-M(X) which takes dictionary as input and returns the name of student pair having minimum and maximum marks in the class. If input dictionary is empty return "Invalid Input".

Ex: Input : { 'Amit': 21, 'Aniket':34, 'Rohit': 53 }, Output: ('Amit', 'Rohit' )

Input: { } , Output: Invalid Input


Make a C++ program that will print this output using while loop.

1

16

49

100

169



Ayush is learning python programming. He has given some task to do on dictionary, but he don't know anything about dictionary but he is good in concepts of list. Your task is to write a python function Co-Dic(Y) function which takes a dictionary as input and convert it into list of list as shown in the example.

Ex1: Input- {1:'Arnab Goswami' , 2: 'Michael Stone', 3: 'Rajesh Mishra, 4:'Chris Jordan'}

Output - [ [1,'Arnab Goswami'],[2,'Michael Stone'],[3,'Rajesh Mishra'], [4,'Chris Jordan'] ]

2 . Input- {3.2: 214, 00.000: 25, 3: 'Man', 0.00: 31}

Output- [ [3.2,214], [0,31], [3,'Man'] ]


Write an application that accepts the unit weight of a bag of coffee in pounds and

the number of bags sold and displays the total price of the sale, computed as

total price = unitweight * number of units * INR 25;

total price with tax = total price + totalprice * INR 0.70,

where 25 is the cost per 200grams and 0.70 is the sales tax. Use data type of

float.


Write a code (or pseudo-code) for summing the first N odd numbers.

Compose an Employee class with the attributes personalia, employeeNo, yearofAppointment, monthSalary, and taxPercent. In addition to get methods for all the attributes, the following operations should be available :

Find the employee’s monthly tax.

Find the gross annual salary

Find tax savings per year. To our employees June is tax free, and in December there’s only half the usual tax.

Find name (in the format last name, first name.)

Find age

Find number of years employed at the company.

Find out if the person has been employed for more than a given number of years

Set methods to change attributes that it makes sense to change.

Find out in which cases an instance of the Employee class has to collaborate with its personalia object in order to complete these tasks. Draw sequence diagrams for these operations.Write a simple program that puts data into an instance of the Employee class and calls all the methods you’ve created. Check that the results are correct


LATEST TUTORIALS
APPROVED BY CLIENTS