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 an application for a furniture company; the program determines the price of a table. Ask




the user to choose one for pine, 2 for oak, or three for mahogany. The output is the name of the




wood chosen as well as the price of the table. Pine tables cost $100, oak tables cost $225, and




mahogany tables cost $310. If the user enters an invalid wood code, set the price to zero. Save




the file as Furniture.cs

Write an application that prompts the user for a checking account balance and a savings account balance (The balance of these two account should be generated automatically by the program within this range 1 to 100 rand and stored into an array ). Display the message “Checking account balance is low” if the checking account balance is less than R10. Display the message “Savings account balance is low” if the savings account balance is less than R100. Save the file as Balance.java.

Marks allocation 

1. Use of a random function- 5

2. use of an array to store the generated balance -5

3. use of an if statement -5

4 . Display of correct output -10

Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text. 

Ex: If the input is:

Hello there
Hey
done

then the output is:

ereht olleH
yeH

Write a C program to calculate the area and perimeter of triangle, square, circle and rectangle


by using the switch case statements.(Uses nested switch case statements).

Write a program that calculates and displays the income tax of a salary entered from the keyboard. Your program must calculate taxes according to the following rates:




Up to 200Br 0%




200Br .600Br 10%




600Br 1200Br 15%




1200Br 2000Br 20%




2000Br-3500Br 25%




3500Br & above 30%

Using the provided recording and your knowledge from programming 1. Create a program in java that takes in an input from the user and checks whether it’s a number or a word. In case a number is entered the program should print the number to the power 3 and if a word is entered your program should split that word into 2.



Sample Run 1



Enter a number or word: 7



Output 1:



7 to the power 3= 343



Sample Run 2



Enter a number or word: NAMIBIA



Output 2:



The word split in half is : NAMI and BIA

Friend and Enemy

A group of F friends went to a haunted house.Each member was given a shirt with a number on it ranging from 1 to F. As they entered the haunted house, one of them was kidnapped and an enemy joined them.But unfortunately, the enemy didn't wear the shirt with the same number as the kidnapped one, instead wore the same as some other person.Find the numbers on the shirts of the enemy and the kidnapped person.


Input

The input is a single line containing space-separated positive integers from 1 to F.


Output

The output should be a single line containing the shirt numbers of the enemy and kidnapped person separated by a space.


Explanation

The given array is 3 1 5 2 1.

In the range from 1 to 5, the number 1 has occured twice and 4 is the missing number. So, 1 belongs to the enemy's shirt, and 4 belongs to kidnapped.Hence, the output should be 1 4.


Sample Input1

3 1 5 2 1

Sample Output1

1 4


Sample Input2

1 2 2 4

Sample Output2

2 3


Control Structures: As a build-up from the previous question, consider 3 possible scenarios of input: A character, number, or word. Your program should then do the following:

  • In case the input is a character it should indicate if it’s a vowel or not
  • when a number is entered then it’s should check if it’s a prime
  • Finally, if a word is entered the system should check if it’s a palindrome or not.

     Sample Run 1                               Sample Run 3

             Enter a character, number or word : c                  Enter a character, number or word : 

             Output 1 : C is not a vowel                                     Output 3 : 7 is a prime number  

Sample Run 2

              Enter a character, number or word: programming

Output 2: Programming is not a palindrome

 


Read the following scenario and suggest measures that could be taken to improve the security of the computer system.


A Computer Science student has a summer job in the data processing department of a large supermarket. 

One lunchtime he is left alone in the office which he shares with several other employees. He sits down at a colleague’s desk and finds that the PC is still logged on. He browses the menu and comes upon a menu to access the product database. 

The submenu asks if he would like to Add, Delete, Update or View products. He selects Update and changes the price of several items that he wishes to purchase. Then he leaves the office and goes and makes his purchases, before returning and restoring the database to its original state. How could his actions be discovered?




Indicate, in the correct order, the layers of TCP/IP protocol stack that are implemented on the following network components :


End system (host)


Router


Switch

LATEST TUTORIALS
APPROVED BY CLIENTS