CMIS 320 Project 1
Write a justification paper, of at least 2 pages, to your boss
explaining how a relational database solution can be applied to a
current business problem or area for improvement. Assume that your
boss knows nothing about relational database theory. The goal of
this paper is to obtain your boss's approval to proceed with your
stated project. Do not focus on technical aspects of a database
management system. Focus on how the information will be captured,
manipulated, managed, and shared, and the value the database brings
to the organization. Include brief examples of how other industries
(both domestic and international) have successfully used relational
databases to increase efficiency.
In: Computer Science
Homework 5: Lists
Please show code in Pycharm
The task is to create the following three functions to demonstrate techniques for working with lists:
In: Computer Science
Discuss the advantages and disadvantages of using DHCP.
In: Computer Science
write code using Arduino to display the digits of pi(π) to the 20th decimal point on a 7-segment display. You code should include functions for all the digits, and your loop( ) should only call the functions to display the numbers. Delay 500ms between each number. Use macro definitions for the individual LED's.
In: Computer Science
One customer has sent you the following email to initiate a project.
“I need to make a report program manager using the internet data from internet system. I only need the data related to signal strength and customer satisfaction rating. I need to be able to sort this by state.” What are the followup questions, and what research you would do before meeting the program manager with the customer what information would you add on the requirement document.
In: Computer Science
use c++
This question is about providing game logic for the game of craps
we developed its shell in class. At the end of the game, you should
ask the user if wants to play another game, if so, make it happen.
Otherwise, quit
**Provide the working output of this game and the picture of the output. **
This is an implementation of the famous 'Game of Chance'
called 'craps'.
It is a dice game. A player rolls 2 dice. Each die has six faces:
1, 2, 3, 4, 5, 6.
Based on the values on the dice, we play the game until a player
wins or loses.
You add the values of the dice's face.
1) If the sum is 7 or 11 on the first roll, the player wins.
2) If the sum is 2, 3, or 12 on the first roll, the player loses (
or the 'house' wins)
3) If the sum is 4, 5, 6, 8, 9, or 10 on the first roll, then that
sum becomes the player's 'point'.
4)To win, the player must continue rolling the dice until he/she
'make the point'.
5)If the player rolls a 7 he/she loses.
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <random>
enum class Status { CONTINUE, WON, LOST};
unsigned int rollDiceAdvanced(); // same as above, but used advance
c++ Random Number generation.
// global variable to use in the advanced version
of RNG (Random number Generator)
std::default_random_engine engine{ static_cast<unsigned
int>(time(0)) };
std::uniform_int_distribution<unsigned int> randomInt{ 1, 6
};
int main()
{
Status gameStatus; // can be CONTINUE, WON, or
LOST
unsigned int myPoint{ 0 };
unsigned int sumOfDice = rollDiceAdvanced(); // first roll of dice.
// bellow the game logic: Provide the game logic
return 0;
}
// this is distribution based random number generation in c++
unsigned int rollDiceAdvanced()
{
unsigned int firstRoll{ randomInt(engine) };
unsigned int secondRoll{ randomInt(engine) };
unsigned int sum{ firstRoll + secondRoll };
std::cout << "rollDiceAdvance: " << sum
<< std::endl;
return sum;
}
In: Computer Science
Write a program to toss a coin multiple times. Ask the user for how many times to toss the coin and then display the percentage of heads and tails (do not display each toss, just the totals). JAVA
In: Computer Science
<?php # Script 10.5 - #5
// This script retrieves all the records from the users
table.
// This new version allows the results to be sorted in different
ways.
$page_title = 'View the Current Users';
line 6 include('includes/header.html');
echo '<h1>Registered Users</h1>';
require('mysqli_connect.php');
// Number of records to show per page:
$display = 10;
// Determine how many pages there are...
if (isset($_GET['p']) && is_numeric($_GET['p'])) { //
Already been determined.
$pages = $_GET['p'];
} else { // Need to determine.
// Count the number of records:
$q = "SELECT COUNT(user_id) FROM users";
$r = @mysqli_query($dbc, $q);
$row = @mysqli_fetch_array($r, MYSQLI_NUM);
$records = $row[0];
// Calculate the number of pages...
if ($records > $display) { // More than 1
page.
$pages = ceil
($records/$display);
} else {
$pages = 1;
}
} // End of p IF.
// Determine where in the database to start returning
results...
if (isset($_GET['s']) && is_numeric($_GET['s'])) {
$start = $_GET['s'];
} else {
$start = 0;
}
// Determine the sort...
// Default is by registration date.
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : 'rd';
// Determine the sorting order:
switch ($sort) {
case 'ln':
$order_by = 'last_name ASC';
break;
case 'fn':
$order_by = 'first_name ASC';
break;
case 'rd':
$order_by = 'registration_date
ASC';
break;
default:
$order_by = 'registration_date
ASC';
$sort = 'rd';
break;
}
// Define the query:
$q = "SELECT last_name, first_name, DATE_FORMAT(registration_date,
'%M %d, %Y') AS dr, user_id FROM users ORDER BY $order_by LIMIT
$start, $display";
$r = @mysqli_query($dbc, $q); // Run the query.
// Table header:
echo '<table width="60%">
<thead>
<tr>
<th
align="left"><strong>Edit</strong></th>
<th
align="left"><strong>Delete</strong></th>
<th align="left"><strong><a
href="view_users.php?sort=ln">Last
Name</a></strong></th>
<th align="left"><strong><a
href="view_users.php?sort=fn">First
Name</a></strong></th>
<th align="left"><strong><a
href="view_users.php?sort=rd">Date
Registered</a></strong></th>
</tr>
</thead>
<tbody>
';
// Fetch and print all the records....
$bg = '#eeeeee';
79 while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC))
{
$bg = ($bg=='#eeeeee' ? '#ffffff' : '#eeeeee');
echo '<tr bgcolor="' . $bg .
'">
<td align="left"><a
href="edit_user.php?id=' . $row['user_id'] .
'">Edit</a></td>
<td align="left"><a
href="delete_user.php?id=' . $row['user_id'] .
'">Delete</a></td>
<td align="left">' .
$row['last_name'] . '</td>
<td align="left">' .
$row['first_name'] . '</td>
<td align="left">' .
$row['dr'] . '</td>
</tr>
';
} // End of WHILE loop.
echo '</tbody></table>';
92 mysqli_free_result($r);
mysqli_close($dbc);
// Make the links to other pages, if necessary.
if ($pages > 1) {
echo '<br><p>';
$current_page = ($start/$display) + 1;
// If it's not the first page, make a Previous
button:
if ($current_page != 1) {
echo '<a
href="view_users.php?s=' . ($start - $display) . '&p=' . $pages
. '&sort=' . $sort . '">Previous</a> ';
}
// Make all the numbered pages:
for ($i = 1; $i <= $pages; $i++) {
if ($i != $current_page) {
echo '<a
href="view_users.php?s=' . (($display * ($i - 1))) . '&p=' .
$pages . '&sort=' . $sort . '">' . $i . '</a> ';
} else {
echo $i . '
';
}
} // End of FOR loop.
// If it's not the last page, make a Next
button:
if ($current_page != $pages) {
echo '<a
href="view_users.php?s=' . ($start + $display) . '&p=' . $pages
. '&sort=' . $sort . '">Next</a>';
}
echo '</p>'; // Close the paragraph.
} // End of links section.
Line 124 include('includes/footer.html');
?>
==============================
Warning: include(includes/header.html): failed
to open stream: No such file or directory line
6
Warning: include(): Failed opening
'includes/header.html' for inclusion (include_path='.;C:\php\pear')
on line 6
Registered Users
Warning: mysqli_fetch_array() expects parameter 1
to be mysqli_result, boolean on line 79
Warning: mysqli_free_result() expects parameter 1
to be mysqli_result, boolean on line 92
Warning: include(includes/footer.html): failed to
open stream: No such file or directory on line
124
Warning: include(): Failed opening
'includes/footer.html' for inclusion (include_path='.;C:\php\pear')
on line 124
In: Computer Science
Write an application that asks the user for a natural number. Display all the natural numbers up to and including the user's input. Also display the sum of all those numbers. JAVA
In: Computer Science
For each of the strings below, does the pattern [^O]*o+ match the string? If so, list which part of the string will be matched. If not, then state "no match". (a) balloons (b) FOODY (c) bookstore (d) "Look" (e) PoolRoOM
In: Computer Science
Fix the C++ code to count the number of inversions using the
given array.
The answer is 8 inversions, but I am only getting
6 inversions.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <iostream>
using namespace std;
int mergeInversion(int arr[], int l, int m, int r)
{
// size of the two arrays
int n1 = m - l + 1;
int n2 = r - m;
// create temporary arrays
int L[n1];
int R[n2];
// Copy the data over into the temp
arrays
for(int i = 0; i < n1; ++i)
{
L[i] = arr[l+i];
}
for(int j = 0; j < n2; ++j)
{
R[j] = arr[m + 1 +
j];
}
// Counting the inversions.
int counter = 0;
for(int i = 0; i < n1; i++)
{
for(int j = 0; j <
n2; j++)
{
if(L[i] > R[i]) // check if its an inversion
{
counter++;
}
}
}
return counter;
}
// Divide-and-Conquer for inversions
int countInversions(int arr[], int l, int r)
{
int countIs = 0;
if(l < r)
{
// find middle pt
int m = (l+r)/2;
// sort the first
half and last half
countIs = countIs +
countInversions(arr, l, m); // first half
sub-array doing inversion recursively
countIs = countIs +
countInversions(arr, m+1, r); // last half sub-array
doing inversion recursively
// now conquer by
merging the sub-arrays!
countIs = countIs +
mergeInversion(arr, l, m, r); // count the inversions
in both arrays
}
return countIs;
}
// driver
int main()
{
// part(c) using the input a = [2, 6, 1, 5, 4,
3]
int a[] = {2, 6, 1, 5, 4, 3};
// array size
int n = sizeof(a)/sizeof(*a);
cout << "\nTotal # of Inversions: "
<< countInversions(a, 0, n-1);
return 0;
}
In: Computer Science
Python 2.7 Question: If-Else Statement
Is there a way for me to ask the user a series of questions with an if-else statement? For example, if a statement is true ask these questions, if false ask these questions. This is what I have so far:
if user_input == "yes ":
ques.check_string("Enter Name: ")
ques.check_string("Enter email: ")
elif user_input != "yes":
ques.check_string("Enter Name: ")
ques.check_string("Enter phone number: ")
In: Computer Science
As a programmer, you have been asked to write a Java
application, using OOP concepts, for a Hospital with the following
requirements:
• The Hospital has several employees and each one of them has an ID
(int), name (string), address (string), mobile phone number
(string), email (string) and salary (double) with suitable data
types. • The employees are divided into:
o Administration staff: who have in addition to the previous
information their position (string). o Doctor: who have also a rank
(string) and specialty (string).
The project requirements: • You will need to create all the needed
Java classes with all the required information. • You have to apply
all the OOP (Object Oriented Programming) concepts that we have
covered in this
module (i.e. inheritance, polymorphism, interface and
collections)
• Include a Microsoft Word document (name it as readme.doc) that
includes several screenshots of
your Netbeans IDE application GUI interface as well as the output
screenshot results. Provide all
assumptions that you have made during design and
implementation.
• Include the whole Netbeans Java project with all source codes.
Write as much comments as possible
At the end, you will need to create a testing class (e.g.
Hospital.java) with the static main() method with the following
requirements:
• It must have an initial fixed collection of working staff (at
least 3 administration staffs and 2
doctors)
• The program will print a selection screen where the user can
choose the operation
he/she wants to perform. The selection screen will be repeated
after each selection until the staff
type the number 4 to completely exit from the program:
1. Add an administration staff (by providing all her/his
information) to the list of all
administration staff
2. Add a doctor (by providing all her/his information) to the list
of all doctors
3. Print all working staff (remember to differentiate between
administration staff and doctors
in the output printout
4. Exit the program
In: Computer Science
simple python program : include comments please
Let's continue to practice an example using the PriorityQueue from the queue module in Python:
Suppose you have been tasked with writing a program that will track the registration waiting list for CCIS 100. Priority is given to seniors, then juniors, etc...
In: Computer Science
Define a regular expression that will correctly (and exactly) match a valid Gregorian calendar date of the form MM/DD/YYYY (with leading zeroes for single-digit months and days) (and ONLY dates in this format). • Months 1, 3, 5, 7, 8, 10, and 12 have 1–31 days • Months 4, 6, 9, and 11 have 1–30 days • Month 2 (February) has 1–28 days (ignore leap years) • Assume that the year falls into the range 1900–2099 HINT: You may find it helpful to define several patterns and combine them using the alternation operator.
In: Computer Science