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 program to calculate the cost of long distance call

• Any call made between 8:00 AM and 6:00 PM, Monday through Friday, is billed at rate of 6 rupees per min.

• Any call made before 8:00 AM or after 6:00 PM, Monday through Friday, is charged at rate of 3.75 rupees per min

• Any call made on a Saturday or Sunday is charged at a rate of 1.5 rupees per min.



The program will input the day of the week along with other inputs. The day of the week will be read as one of the following pairs of characters, which are stored in two variables char:

Mo,Tu,We,Th,Fr,Sa,Su.


If call is started on Friday at 11:55 PM and ends at 12:05 AM on Saturday then rate of call be calculated as cost of call as per schedule on Friday for first 5 min plus the cost of call as per schedule on Saturday for rest of the 5 min. Similarly, if call starts on Sunday at 11:55 PM and ends at 12:05 AM on next day i.e. Monday, then cost of the call be calculated as charges as per schedule on Sunday plus charges as per schedule on Monday.


Given a string, create a new string with all the consecutive duplicates removed.




Hint: You may make a new string to store the result. You can check whether the current character and the next character are the same, then add that character to the new string.




Note: Only consecutive letters are removed not all duplicate occurences of a letter. You may try doing this alternative i.e. removing all duplicate letters from a given string, for your own practice.




Sample Input 1:



AAABBBBCDDBBECE




Sample Output 1:


ABCDBECE




Sample Input 2:



Jupyter Notebook is better. Case sensitivity check AAaaaAaaAAAa.




Sample Output 2:



Jupyter Notebok is beter. Case sensitivity check AaAaAa.

Write a python program that splits a given string on a given split character. The first input is a String and the second input is the character that will be used to split the first String.



[You cannot use the built-in split function for this task]



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



Sample Input 1:


This-is-CSE110


-



Sample Output 1:


This


is


CSE110



Explanation: The second input which is the character '-', is used to split or divide the first input String 'This-is-CSE110' into 'This', 'is' and 'CSE110' which are printed individually in separate lines.



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



Sample Input 2:


tom@gmail,harry@yahoo,bob@gmail,mary@gmail



,



Sample Output 2:



tom@gmail



harry@yahoo



bob@gmail



mary@gmail

A method called absoluteValue, which takes as its only parameter a value of type double, and

returns a value of type double. The parameter represents an arbitrary number, and the value returned

by the method represents the absolute value of this arbitrary number. The absolute value of a number

x, denoted |x|, is x if x is greater than or equal to 0, and -x if x is less than 0. For example, suppose the

following method call is executed:

double value = MathAssignment.absoluteValue(-42.0);

After the execution of the above method call, the value stored in variable value will be 42.0, as the

absolute value of -42 is 42.

3. Now write the main method and call both methods with appropriate arguments. Make sure that you

call both methods with enough valid values to show their


You are required to write a C++ program to read in one customer’s account balance at the beginning of the month, a total of all withdrawals for the month, and a total of all deposits made during the month. A federal tax charge of 1% is applied to all transactions made during the month. The program is to calculate the account balance at the end of the month by 

(1) subtracting the total withdrawals from the account balance at the beginning of the month, (2) adding the total deposits to this new balance, 

(3) calculating the federal tax (1% of total transactions, i.e.total withdrawals + total deposits), 

(4) subtracting this federal tax from the new balance. 

 

After these calculations, print the final end-of-month balance.



Write a shell program which allows user to add data in a file emp.dat . Allow user to enter data from keyboard. The format for data file is given below

empid: ename: sal: age

If empid exits in a file then do not allow duplicate value to be inserted into file.

Write a menu driven shell script to list all the files of the current directory having read, write permission and read write permission to the user.

a.     Read permission

b.     Write permission

c.      Read and write permission

d.     exit 

Write a shell program where user will take name of person. The program will return corresponding age of person on console .Shell will read value from a file called as info.txt where user information is stored in the format mentioned below

Name:Age

Create an Inventory class that a warehouse might use to represent their stock of products and raw materials. Include a data member of type string to provide a description of the product, and data member of type int to represent the balance stock. Provide a constructor that receives an initial product and uses it to initialize the data members. The constructor should validate the initial product to ensure it has a stock greater than 20, which is the company’s minimum stock level. If not, it should display an error message. Provide three member functions. Member function Purchase should add a product to the current stock. Member function Sale should reduce stock. Ensure after each sale that the stock level does not drop below 20. Member function getStock should return the current stock. Create a program that creates two Inventory objects and tests the member functions of the class.


 Create a class called Employee that includes three pieces of information as data members, a name (type string), ID (type integer) and a monthly salary (type integer). Employee class should have a constructor that initializes the three data members. And employee class should have a destructor which shows message when object of the class is destroyed from the memory. Provide a “setData” and a “getData” function for each data member. If the monthly salary is not positive, set it to -1.

Write a test program that demonstrates class Employee’s functionalities. Create two Employee objects and display each object’s yearly salary after deducting 4% tax.

Note...Its C# Question


LATEST TUTORIALS
APPROVED BY CLIENTS