I need new and unique answers, please. (Use your own words, don't copy and paste),
Please Use your keyboard (Don't use handwriting) Thank you..
IT101
Q1:Data Modelling is the primary step in the process of database design. Compare and contrast Conceptual data model versus Physical data model. Illustrates with help of example to list down data (entities), relationship among data and constraints on data.
Q2:What strategic competitive benefits do you see in a company’s use of extranets?
Q3:Explain how Internet technologies are involved in developing a process in one of the functions of the business? Give an example and evaluate its business value.
Q4:
What are the basic differences between HRM, Intranet and Internet in terms of Domain and Network Communication Scope?
HRM Intranet |
HRM Internet |
|
Domain |
||
Network Communication Scope |
In: Computer Science
python
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<center> <h1>CpE 4040 Midterm-2 Exam</h1>
</center>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1- Write a Python code which asks two numbers from the user,
calculates the sum and print the result. Create a function to
calculate the summation and return the result
value.<br>\n",
"i.e. <br>\n",
"First Number:12 <br>\n",
"Second Number:23 <br>\n",
"12 + 23 = 35"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"2- Create 20 random integers in an array which has the numbers
between 10 and 100 (includes 10 and 100). Sort and print the
numbers in descending order."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"3- Write a Python code that asks a string from the user and prints
only the lower case letters in that string."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"4- Create an evenly spaced 21-element array between 2.2 and 12.4.
Find the median of the array. Print both the array and median
value. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"5- Write a simple number guessing game Python program. In this
code, generate a random integer between 1-10 (both included) and
ask the user to guess the number in three attempts. \n",
"Print appropriate responses to the user such as \"You won!\" or
\"You failed\" "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"6- Generate an array of numbers from 1 to 15. Reshape it to make
3x5 matrix. Convert the matrix into data frame and print the even
number of columns. "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
In: Computer Science
Discuss this statement; “Banking everywhere, but not at the bank”. *
(10 Marks
In: Computer Science
PHP
You will be using the object oriented features of PHP to design a music album processing page.
First you will build a form page called addAlbum.php. This form will contain text fields for album title, artist, publisher (Sony, BMI, etc.) and genre. Add two more fields of your choice. You will post this form to the file process.php.
If all the fields have values, we will create a new Album object and print the details of the object. You will need to create an Album class that has private instance variables for all the fields just described. Your constructor should simply echo to the screen "Album created." If the user missed some of the form, give them a link to go back and fix.
Generate standard getters/setters
You will need to create __get and __set functions (magic functions) to allow us to set the properties of the instance variables from outside the class. You will also create a function (or method) called __toString() in the class. Calling this will return a formatted string of all the details for the album. Store the class in album.class.php.
Include a hyperlink back to add another album.
Sample output could look like this:
Album Created
Album Title: Blaze of Glory
Artist: Jon Bon Jovi
Publisher: ASCAP
Genre: Rock
Custom Field: stuff
Another Custom Field: stuff
Add another album! (This is an hyperlink to add another album)
Requirements
i. Comments on all pages, proper page names (as requested),
aligned code, overall effort
ii. addAlbum.php page is complete - doctype, complete html
structure and some instructions that give the user some indication
of what they are to do
iii. album.class.php - contains code to define album class - as
well as documentation/comments to outline how to use - see
requirements for details (private vars, constructor, magic
methods(__get(),__set() and __toString functions)
iv. Some type of validation used so that user knows about
errors
v. Styles for all pages: Use an external stylesheet for all styles.
All page content should be in a div with an id set to 'container',
650px wide and the content centered.
vi.The container div should also be centered on the screen
(horizontally). The constructor text should be echoed using an
<h3> tag. Please bold all labels as displayed above.
vii. Use the Button class to print the submit button on the form
page addAlbum.php.
In: Computer Science
Suppose you are choosing between the following two algorithms:
Algorithm A: solves problems of size n by recursively solving two subproblems each of size (n-1) and then combining the solutions in constant time (take T(0) = 0).
Algorithm B: solves problems of size n by recursively solving one subproblem of size (n-1) and then combining the solution in (log n) time (take T(1) = 0).
In: Computer Science
course: System Integration
question: “The software design/development team and test engineers need to develop a strategy for planning, design, execution, data collection, and test evaluation”. Discuss this statement.
note: need a unique answer and no handwriting please.
In: Computer Science
JAVA
Write a program that prompts the user to enter the exchange rate from currency in U.S. dollars to Saudi Riyals. Prompt the user to enter 0 to convert from U.S. dollars to Saudi Riyals and 1 to convert from Saudi Riyal and U.S. dollars. Prompt the user to enter the amount in U.S. dollars or Saudi Riyal to convert it to Saudi Riyal or U.S. dollars, respectively.
Here are the sample runs:
Enter the exchange rate from
dollars to SR: 3.75
Enter 0 to convert dollars to SR and 1 vice versa: 0
Enter the dollar amount: 100
$100.0 is 375.0 SR
In: Computer Science
Complete Chapter 5, Programming Activity 1: Working with "if/else". Make sure you study the Programming Activity 5-1 Guidance document. Which part of the guidance document was the most helpful to you? Why? At the end of your student code, also add the following statement: System.out.println("Score = " + score + " and result = " + result); This code displays your code's result for each input value in the console window. Discuss your experience writing and testing this activity. Discuss the usefulness of the program's visual output in helping you understand the flow of your code. Discuss why you think this programming activity was easy or difficult.
Programming Activity 5-1 Guidance ================================= Input parameter --------------- The parameter "score" is passed into the function where you put your code. Therefore, it is available for you to use in your code. Outputs ------- There are 3 possible outputs: "over par" "par" "below par" It is correct for the JOptionPane to pop-up after each time you enter a value. This allows you to try each test value without having to rerun the application. When you are done testing, click its Cancel button or the red X in the upper right corner of its window. Source files ------------ For all of the textbook activities, you must copy all of the source files provided in our course Textbook Activity Frameworks folder. When you compile or run the program, you must be in the correct source file in TextPad. For this activity, it is the PathClient.java file. Test cases ---------- Make sure you test with each of the recommended test cases: 45, 71, 72, and 73. Not every assignment will tell you the recommended test cases. When they are not provided, you must determine representative test cases.
In: Computer Science
Python: Write a recursive function that accepts an integer argument, n. The function should display n lines of asterisks on the screen, with the first line showing 1 asterisk, the second line showing 2 asterisks, up to the nth line which shows n asterisks. Test the function.
In: Computer Science
BACKGROUND
Substitution ciphers that encode a message by substituting one character for another go back at least as far as Julius Caesar, who used a rotating character scheme to encode military orders. This simple type of encryption is vulnerable to statistical attacks, however, as anyone who has solved CRYPTOGRAM puzzles can attest. In World War II, the Nazi military employed an encryption scheme that addressed this weakness of simple substitution ciphers. This scheme, implemented by typewriter-sized devices known as Enigma machines, gave the Nazis a tactical advantage that greatly contributed to their early success in the war. In fact, the eventual breaking of this coding scheme by researchers at Bletchley Park, England (including Alan Turing) is hailed as one of the turning points of the war.
Enigma machines used interchangeable rotors that could be placed in different orientations to obtain different substitution patterns. More significantly, the rotors rotated after each character was encoded, changing the substitution pattern and making the code very difficult to break. The behavior of the rotating rotors can be modeled, in a simplified form, by a device consisting of labeled, concentric rings. For example, the model below has three rings labeled with the letters of the alphabet and '#' (representing a space).
To encrypt a character using this model, find the character on the inner rotor (i.e., the inside ring) and note the character aligned with it on the outer rotor (i.e., the outside ring), then find that character on the middle rotor (i.e., the middle ring) and output the one aligned with it on the outer rotor. After a character is encrypted, turn the inner rotor clockwise one step. Whenever the inner rotor returns to its original orientation, the middle rotor turns once in lock-step, just like the odometer in a car.
For example, in this configuration the character 'A' would be encrypted as 'N', since 'A' on the inner rotor is aligned with 'H' on the outer rotor, and 'H' on the middle rotor is aligned with 'N' on the outer rotor. After performing this encryption, the inner rotor is rotated clockwise, so the letter 'A' would next be encrypted as 'D'.
1 Adopted from Nifty Assignments - SIGCSE 2009 (http://nifty.stanford.edu/2009/reed-enigma/)
In other words, the rings are used in the following order: InnerOuterMiddleOuter. Note that decrypting a message requires following the same steps, only in reverse (i.e., find the character on the outer rotor, note the character aligned with it on the middle rotor, find that character on the outer rotor, then output the character aligned with it on the inner rotor). In short: Outer Middle Outer Inner.
ASSIGNMENT DESCRIPTION
For this assignment, you are to design and implement a Java class named Enigma that simulates this three-ring model of an Enigma machine. You may assume that all Enigma models have the same outer rotor, as shown in the above diagram. That is, the outer rotor consists of the 26 capital letters and the '#' symbol (representing a space) in the following clockwise order: #BDFHJLNPRTVXZACEGIKMOQSUWY. Since the middle and inner rotors are interchangeable, their contents and alignment relative to the outer rotor must be specified when constructing an Enigma model. For example, the initial settings of the inner and middle rotors in the above diagram are #GNUAHOVBIPWCJQXDKRYELSZFMT and #EJOTYCHMRWAFKPUZDINSXBGLQV, respectively. Using an Enigma object, it should be possible to both encode and decode text messages, with the appropriate rotation of the rotors occurring after each character encoding/decoding.
You should also design and implement a client program. For users who do not want to specify their own rotor settings, have a “default” option that uses the setting shown in the diagram. In addition, create an option that makes it simple for the user to specify the rotor settings on an Enigma model, and encode or decode text.
SPECIFIC TASKS
Using the outlines provided as a starting point:
Complete all method stubs in the Enigma class (Enigma.java). You are welcome to add additional methods as needed to facilitate procedural decomposition
Implement a user-friendly client program (EnigmaClient.java)
Provide user instructions fully explaining how to use your program for making your
program user-friendly
Fully demonstrate the proper functioning of your program by providing samples
input/output
Design and implementation guidelines:
Javadoc comment all class files and methods
Handle exceptions as appropriate and include @throws documentation in Javadoc
comments
Structured code - use methods to eliminate redundancy and break large methods into
smaller, logical sub problems
ENIGMA CLASS OUTLINE
This Enigma class outline contain method “stubs” along with commented descriptions of what each method should do. You need to write the actual methods, with the appropriate inputs and outputs. An example of a method stub is provided below:
This method stub tells you that the method takes a String as input and returns a Boolean value. The comments provided in the method stub list some hints on how the String should be validated. You need to write the method and the Javadoc comment. You should also comment your code using line comments as you see fit.
WHAT TO SUBMIT
You will need to submit the following files:
Your Enigma.java file
Your EnigmaClient.java file
A text document showing how you tested your program (include screen shots or copy and
paste sample output). Include a “Reflections” section in this text document that discusses any difficulties you had with the assignment, what you learned, what you found interesting, etc.
PLEASE MAKE SURE THE JAVA FILES YOU SUBMIT COMPILE AND RUN – EVEN IF YOU ARE NOT ABLE TO FINISH THE PROGRAM COMPLETELY AND/OR CORRECTLY.
Sample output is provided below. You do not have to recreate this format exactly, but your program should have similar behavior.
SAMPLE PROGRAM OUTPUT
1. Upon running the program:
2. After first user selection:
3. After second user selection:
NOTE: You do not have to keep printing out rotor
settings, but you may find this feature helpful when you are trying
to write the encryption and decryption methods.
In: Computer Science
Subject- ( App Development for Web) ( language C#, software -visual studio)
I have created a 'Calculator' named program in visual studio. This is the main console program(Program.cs) shown below. Then i have created a "CaculatorLibrary" named project by adding the project from FILE--->ADD--->NEW PROJECT. Then i selected library and selected classLibrary(.NETcore). The programs for both are given below. There are no errors in the program. Now the requirement is to build unit test project within this project that will perform atleast 10 tests.The tests must be like add rwo positive numbers,multiply two positive numbers and so on ... . This test project will also be created by FILE--->ADD--->NEW PROJECT.But here instead of library select test .
Program.cs
using CalculatorLibrary;
using System;
namespace CalculatorProgram
{
class Program
{
static void Main(string[] args)
{
bool endApp = false;
// Display title as the C# console calculator app.
Console.WriteLine("Console CalculatorProgram in C#\r");
Console.WriteLine("------------------------\n");
Calculator Calculator = new Calculator();
while (!endApp)
{
// Declare variables and set to empty.
string numInput1 = "";
string numInput2 = "";
double result = 0;
// Ask the user to type the first number.
Console.Write("Type a number, and then press Enter: ");
numInput1 = Console.ReadLine();
double cleanNum1 = 0;
while (!double.TryParse(numInput1, out cleanNum1))
{
Console.Write("This is not valid input. Please enter an integer
value: ");
numInput1 = Console.ReadLine();
}
// Ask the user to type the second number.
Console.Write("Type another number, and then press Enter: ");
numInput2 = Console.ReadLine();
double cleanNum2 = 0;
while (!double.TryParse(numInput2, out cleanNum2))
{
Console.Write("This is not valid input. Please enter an integer
value: ");
numInput2 = Console.ReadLine();
}
// Ask the user to choose an operator.
Console.WriteLine("Choose an operator from the following
list:");
Console.WriteLine("\ta - Add");
Console.WriteLine("\ts - Subtract");
Console.WriteLine("\tm - Multiply");
Console.WriteLine("\td - Divide");
Console.Write("Your option? ");
string op = Console.ReadLine();
try
{
result = Calculator.DoOperation(cleanNum1, cleanNum2, op);
if (double.IsNaN(result))
{
Console.WriteLine("This operation will result in a mathematical
error.\n");
}
else Console.WriteLine("Your result: {0:0.##}\n", result);
}
catch (Exception e)
{
Console.WriteLine("Oh no! An exception occurred trying to do the
math.\n - Details: " + e.Message);
}
Console.WriteLine("------------------------\n");
// Wait for the user to respond before closing.
Console.Write("Press 'n' and Enter to close the app, or press any
other key and Enter to continue: ");
if (Console.ReadLine() == "n") endApp = true;
Console.WriteLine("\n"); // Friendly linespacing.
}
return;
}
}
}
CalculatorLibrary.cs
using System.Diagnostics;
using System;
using System.IO;
namespace CalculatorLibrary
{
public class Calculator
{
public Calculator()
{
StreamWriter logFile = File.CreateText("calculator.log");
Trace.Listeners.Add(new TextWriterTraceListener(logFile));
Trace.AutoFlush = true;
Trace.WriteLine("Starting Calculator Log");
Trace.WriteLine(String.Format("Started {0}",
System.DateTime.Now.ToString()));
}
public double DoOperation(double num1, double num2, string
op)
{
double result = double.NaN; // Default value is "not-a-number"
which we use if an operation, such as division, could result in an
error.
// Use a switch statement to do the math.
switch (op)
{
case "a":
result = num1 + num2;
Trace.WriteLine(String.Format("{0} + {1} = {2}", num1, num2,
result));
break;
case "s":
result = num1 - num2;
Trace.WriteLine(String.Format("{0} - {1} = {2}", num1, num2,
result));
break;
case "m":
result = num1 * num2;
Trace.WriteLine(String.Format("{0} * {1} = {2}", num1, num2,
result));
break;
case "d":
// Ask the user to enter a non-zero divisor.
if (num2 != 0)
{
result = num1 / num2;
Trace.WriteLine(String.Format("{0} / {1} = {2}", num1, num2,
result));
}
break;
// Return text for an incorrect option entry.
default:
break;
}
return result;
}
}
}
In: Computer Science
Problem 01: GroceryCalculator
Write a program to calculate the cost of a list of grocery items. It includes one attribute: totalCost. It includes five user-defined methods:
Problem 02: Dog
“Hi, my name is Lucky. I am a Chiwawa. I am 3 years old, and my color is white.”
In: Computer Science
Please answer in JAVA
I am using java.time.Duration class.
1.). How can I add all of the given duration time?
for example:
Duration t1 = Duration.ofMinutes(2).plusSeconds(30)
Duration t2 = Duration.ofMinutes(3).plusSeconds(20)
then the result would be total = Duration.ofMinutes(5).plusSeconds(50)
*** and how would it be if it exceeds 59 minutes and its an hour.
2). How would I be able to add it all up on an ArrayList? does a for loop and simple add() works?
In: Computer Science
You have been tasked to write a C# application that will go
through the first step of encrypting an input file and writing the
encrypted contents to an output file.
For this first step in encryption, read each letter in from the
input file, add 3 letters to the value of the input letter. If the
input letter is an A then the encrypted letter would be a D. If the
input letter from the input file is an X then the encrypted letter
would be an A.
All spaces, digits, punctuation, and special characters do not need
to be encrypted at this level. Simply write the space,
punctuation, or special character to the output file as is.
If a letter is uppercase in the input file, it should remain as an
uppercase character in the output file. If a letter is lowercase in
the input file, it should remain as a lowercase character in the
output file.
Since this program runs each month, the input file will be of
various lengths; therefore, the program will read until end of
file.
The input file is found in the current directory and is named
October20.txt. The output
file will be written to the current directory and named
EncryptOct20.txt.
An example:
If the contents of the input file is
Live long and prosper. |
The output file would be:
Olyh orqj dqg survshu. |
What the user should see when the program executes:
When the program begins, the statement "Encryption Level 1" should
be displayed.
The focus should be set to the "Begin Encryption" button.
When the user clicks the "Begin Encryption" button, the program
opens the input file, the statement "Opening input file...." should
be displayed. The "Begin Encryption" button should be
disabled.
When the program begins reading through the input file encrypting
the contents, the statement "Encrypting input file...." should be
displayed.
When the program closes the input and output files, the statement
"Encryption complete...." should be displayed.
When the program is complete, the statement "End of process" should
be displayed.
In: Computer Science
course: IT Data Mining and Data Warehousing
There are several typical cube computation methods such as Multi-Way, BUC, and Star-cubing. Briefly describe each one of these methods outlining the key points.
note: need a unique answer and no handwriting please.
In: Computer Science