Creat a theater booking system in java language using :
1.OOP objects -Classes
2.encapsulation
3.polymorphism
4.inheritance
5.abstract class
In: Computer Science
Im just having some trouble using functions in visual basics. Could you please explain what Im doing wrong? I think it has to do with the calling of the function.
Public Class Form1
Private Sub Button1_Click(sender As Object, e As
EventArgs) Handles Button1.Click
Me.Close()
End Sub
Private Function Rsumation(ByVal intx As
Integer) As Double
intx =
CInt(Txtinput.Text)
If intx = 1 Then
Return 1
Else Return (intx +
Rsumation(intx - 1))
End If
End Function
Private Sub Button2_Click(sender As Object, e
As EventArgs) Handles Button2.Click
MessageBox.Show(CStr(Rsumation(CInt(Txtinput.Text)).ToString("N2")))
End Sub
End Class
In: Computer Science
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127.
Please be careful and explain all the steps and details.
In: Computer Science
In the RSA cryptosystem, Alice’s public key (N, e) is available to everyone. Suppose that her private key d is compromised and becomes known to Eve. Show that if e = 3 (a common choice) then Eve can efficiently factor N.
In: Computer Science
Relation : course(course id, title, dept name, credits)
Explain how to create different indices: primary index, secondary index, dense index, sparse index, respectively. Using above relation, you can either describe based on the definition of the indices or answer with the instance of the relation using some fake data/tuples.
In: Computer Science
C++ (cpp) PLEASE
Write a complete function (prototype and definition) that takes an integer array and the array dimensions as an input. The function should then square each value of the array in-place.
At the completion of the function return a Boolean which indicates the process has completed.
In: Computer Science
Design algorithms for the following operations for a binary tree T:
. preorderNext(p) : Return the position visited after p in a
preorder traversal of T, or NULL if p is the last node
visited.
. inorderNext(p) : Return the position visited after p in an
inorder traversal of T, or NULL if p is the last node
visited.
. postorderNext(p) : Return the position visited after p in a
postorder traversal of T, or NULL if p is the last node
visited.
In: Computer Science
C++
The Caesar cipher is one of the earliest known and simplest ciphers. It is a type of substitution cipher in which each letter in the plaintext is 'shifted' a certain number of places down the alphabet.
|
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
|
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
|
H |
E |
L |
L |
O |
W |
O |
R |
L |
D |
Normal Text |
|
|
B |
Y |
F |
F |
I |
Q |
I |
R |
M |
X |
Encrypted Text |
You are tasked to create an encryption program which takes a key word. The keyword will fill the first part of the shifted array. The remaining letters will fill the end of the array. It should look like this:
Key=”TOY
|
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
|
T |
O |
Y |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
P |
Q |
R |
S |
U |
V |
W |
X |
Z |
You should have an interactive menu with the following options:
1 Enter Key word //takes new key word and re-aligns shifted array
2 Encrypt message//takes a message of 140 characters and encrypts message
3 Decrypt message//takes an encrypted massage of 140 characters and decrypts it
4 Quit//exits program;
A couple tips:
Use the copy function from the <cstring> library not the <algorithm> library. If you use the algorithm library you need to make a change in visual studios precompiler settings or you will get an error. You cannot assign arrays using the ‘=’ operator; only individual indices of the array can be assigned this way.
Take one case or the other for input. All Caps or all lowercase. You can use “toupper(<char>)” to set all letters to upper case: http://cpp.sh/7gwx
/* toupper example */
#include <stdio.h>
#include <iostream>
#include <ctype.h>//for toupper
using namespace std;
int main ()
{
int i=0;
char str[]="Test String.\n";
char c;
while (str[i])
{
c=str[i];
str[i]=toupper(c);
i++;
}
std::cout<<str<<endl;
return EXIT_SUCCESS;
}
When encrypting/decrypting, don’t change characters that are not in your Array set like punctuation and spaces
In: Computer Science
Draw the binary tree representation of the following arithmetic expression:
"( ( ( 6 + 3 ) * ( 3 - 2 ) ) / ( ( 3 + 10 ) + ( ( 8 - 3 ) - 2 ) ) * 9 )"
-Give an O(n)-time algorithm for computing the depth of all positions of a tree T, where n is the number of nodes of T.
In: Computer Science
Chapter 6: Use a list to store the players
Update the program in python so that it allows you to store the players for the starting lineup. This
should include the player’s name, position, at bats, and hits. In addition, the program
should calculate the player’s batting average from at bats and hits.
Console
================================================================
Baseball Team Manager
MENU OPTIONS
1 – Display lineup
2 – Add player
3 – Remove player
4 – Move player
5 – Edit player position
6 – Edit player stats
7 - Exit program
POSITIONS
C, 1B, 2B, 3B, SS, LF, CF, RF, P
================================================================
Menu option: 2
Name: Mike
Position: C
At bats: 0
Hits: 0
Mike was added.
Menu option: 1
Player POS AB H AVG
----------------------------------------------------------------
1 Joe P 10 2 0.2
2 Tom SS 11 4 0.364
3 Ben 3B 0 0 0.0
4 Mike C 0 0 0.0
Menu option: 6
Lineup number: 4
You selected Mike AB=0 H=0
At bats: 4
Hits: 1
Mike was updated.
Menu option: 4
Current lineup number: 4
Mike was selected.
New lineup number: 1
Mike was moved.
Menu option: 7
Bye!
Specifications
Use a list of lists to store each player in the lineup.
Use a tuple to store all valid positions (C, 1B, 2B, etc).
Make sure that the user’s position entries are valid.
In: Computer Science
What is launch angle and Launch velocity(ms) to hit target 153 feet away
In: Computer Science
Write code that will produce the following pyramid for a user designated number of rows (user input).
1
11
121
12321
1235321
(Based on Fibonacci numbers)
*USE JAVA*
In: Computer Science
why study computer architecture and organization
In: Computer Science
convert -44 to 8-bit sign-magnitude, 1's complement, 2's complement and excess-127.
Please be careful and explain all the steps and details.
In: Computer Science