Objective:
The purpose of this assignment is to:
Directions:
Write a C++ program that will create a menu driven program with the following options:
Menu Options:
A) Text to Morse code
B) Quit
If user selects A or a:
If user selects B or b:
Otherwise:
Make sure your program conforms to the following requirements:
1. This program should be called MorseCode.cpp
2. It must provide the functions defined above. You are required to use and define proper C++ functions, but for this program, you are allowed to define them (80 points).
3. Add comments wherever necessary. (5 points)
4. Run the program in linprog.cs.fsu.edu - select option A - redirect output to a file called OutputA.txt (include OutputA.txt in submission and Unix command executed) (5 points)
Sample Runs:
NOTE: not all possible runs are shown below.
Welcome to the Morse code program Menu Options: A) Text to Morse code B) Quit h Menu Options: A) Text to Morse code B) Quit a Enter a word and I will translate it to Morse code. -> sos ... --- ... Menu Options: A) Text to Morse code B) Quit A Enter a word and I will translate it to Morse code. -> ok --- -.- Menu Options: A) Text to Morse code B) Quit a Enter a word and I will translate it to Morse code. -> ?? Error : word contains symbols Menu Options: A) Text to Morse code B) Quit a Enter a word and I will translate it to Morse code. -> ok --- -.- Menu Options: A) Text to Morse code B) Quit B
General Requirements:
1) Include the header comment with your name and other information on the top of your files.
2. Please make sure that you're conforming to specifications (program name, print statements, expected inputs and outputs, etc.). Not doing so will result in a loss of points. This is especially important for prompts. They should match mine EXACTLY.
3. If we have listed a specification and allocated point for it, you will lose points if that particular item is missing from your code, even if it is trivial.
4. No global variables (variables outside of main()) unless they are constants.
5. All input and output must be done with streams, using the library iostream
6. You may only use the iostream, iomanip, vector, and string libraries. Including unnecessary libraries will result in a loss of points.
7. NO C style printing is permitted. (Aka, don't use printf). Use cout if you need to print to the screen.
8. When you write source code, it should be readable and well-documented (comments).
9. Make sure you either develop with or test with g++ (to be sure it reports no compile errors or warnings) before you submit the program.
In: Computer Science
Write a java program that calculates the total amount of money a person has made over the last year. The program will prompt the user for dollar amounts showing how much the user has made per job. Some users will have had more than one job, make sure your program allows for this. The program will print out the total made (all jobs) and will print out the federal and state taxes based on the total made. For this program, the federal tax will be 8.5% and the state tax will be 14.5%.
In: Computer Science
it is required implement 40-Gbps computer network to connect the four building (MB,CB,LB,NHB) in the faculty of engineering given .each building three teaching halls distributed in three floors and it is required to install an independent network with 24 outlet points in each halls six servers will be used to provide the required local storage for each building while a SAN storage and control room will be in communication building(CB).
a) design the required computer network, state the function of each device and specify the typyes of cables you will use and justify your selection
b) explain your solution in terms of network diameter ,bandwidth aggregation and redandant links
In: Computer Science
C language
write a code: Do you want another choice, if yes press (Y or y) then continue , if no press (N or n) then break.
In: Computer Science
Python
Write a script to play two-dimensional Tic-Tac-Toe between two human players who alternate entering their moves on the same computer.
Use a 3-by-3 two-dimensional array. Each player indicates their moves by entering a pair of numbers representing the row and column indices of the square in which they want to place their mark, either an 'X' or an 'O'. When the first player moves, place an 'X' in the specified square. When the second player moves, place an 'O' in the specified square. Each move must be to an empty square. After each move, determine whether the game has been won and whether it’s a draw.
In: Computer Science
•Every element at an even index.
•Every even element.
•All elements in reverse order.
•Only the first and last element.
In: Computer Science
WHAT are the non-visible controls stored in Visual Studio IDE
In: Computer Science
- Delcare variable data type as decimal (5 variables needed) count, price, subtotal, tax, total
- Write a do while loop, if the price is not -1, loop continues show count number enter price get subtotal increase count
- Calculate tax, total
- Display total count, subtotal, tax, total
In: Computer Science
C++ How can I print out the subtrees in my self-balancing tree? What I would like to do is have it display something like " ROOT = X, LEFT PARENT = X, X,X, RIGHT PARENT = X,X,X.
Here is my code:
#include <iostream>
using namespace std;
class TreeNode
{
public:
int data;
TreeNode* left;
TreeNode* right;
};
TreeNode* newNode(int data);
/* A function that constructs Balanced
Binary Search Tree from a sorted array */
TreeNode* convertToBTS(int arr[],
int start, int end)
{
if (start > end)
return NULL;
//make the middle number the root
int mid = (start + end) / 2;
TreeNode *root = newNode(arr[mid]);
root->left = convertToBTS(arr, start,
mid - 1);
root->right = convertToBTS(arr, mid + 1, end);
return root;
}
/* Helper function that allocates a new node
with the given data and NULL left and right
pointers. */
TreeNode* newNode(int data)
{
TreeNode* node = new TreeNode();
node->data = data;
node->left = NULL;
node->right = NULL;
return node;
}
//The array will be sorted in PreOrder
void preOrder(TreeNode* node)
{
if (node == NULL)
return;
cout << node->data << " ";
preOrder(node->left);
preOrder(node->right);
}
int main()
{
const int SIZE = 7;
int arr[SIZE];
int count = 7, num = 0;
cout << "We will construct a Self-Balancing Tree!\n Enter 6 numbers for the nodes." << endl;
for (int i = 0; i < SIZE; i++)
{
cout << "Enter " <<
count << " more items!" << endl;
cin >> arr[i];
count--;
}
int n = sizeof(arr) / sizeof(arr[0]);
/* Convert List to BST */
TreeNode *root = convertToBTS(arr, 0, n - 1);
cout << "The tree will be displayed in
PreOrder!" << endl
<< "First number will be the
ROOT. Then LEFT SUBTREE, and RIGHT SUBTREE." << endl;
preOrder(root);
return 0;
}
In: Computer Science
Describe how the Rational User Process can accommodate agile process. Specify in what phases and what disciplines agile methods could be appropriate.
In: Computer Science
Explain why the client congestion window(cwnd) size varies differently for different load conditions. In context to tcp congestion control using aimd technique and tcp reno protocol.
In: Computer Science
Illustrate with a diagram how basic TCP Windowing works.
In: Computer Science
note: Input-output screen-shot if needed #No-copy paste codes, please.
Q) Create a python functions that rotates the elements of a list by one position. Consider a function rotate(a_list, direction) that takes as arguments the list to rotate, and the direction (left or right) of rotation. Rotate the list in place.
Q) Choice of appropriate data structure is an important step in
designing algorithms. Suppose a text file contains student records
on each line and each record is of the format: Name of Student,
Student ID, GPA. Now consider reading that le to create a list of
lists, a list of tuples or a tuple of tuples.
(a) If you want to create a report using the data, what data
structure would you use?
(b) If you want to modify the name, id or GPA, what data structure would you use?
In: Computer Science
Human computer interaction
An online air ticket reservation company is experimenting with a new interactive user interface design for its customers. Study any leading online air ticket reservation system to understand this interface and using it, give examples of any three social impact of interface design for following elements. You can use screenshots to elaborate your example.
In: Computer Science
Database Design and SQL
Consider the following relations:
Student (snum: integer, sname: string, major: string, level:
string, age: integer)
Class (name: string, meets_at: time, room: string, fid:
integer)
Enrollment (snum: integer, cname: string)
Faculty (fid: integer, fname: string, deptid: integer)
Write the following queries in SQL. Also, there should be no
duplicates printed in any of the answers.
a) Find the names of all students who are enrolled in two classes
that meet at the same time.
b) Find the names of faculty members for whom the combined
enrollment of the courses that they teach is less than five.
c) Print the Level and the average age of students for that Level,
for each Level.
d) Print the Level and the average age of students for that Level,
for all Levels except JR.
e) Find the names of students who are enrolled in the maximum
number of classes.
f) Find the names of students who are not enrolled in any
class.
In: Computer Science