***** please don't copy and paste and don't use handwriting *****
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
Write this program in a C++ language Calculate the ideal age of a spouse. Enter either m or f from the keyboard in lower case. You may use string data for the gender. Convert the gender to upper case
Enter an age from the keyboard, probably an integer
You will need prompts telling the user what to enter.
Use an IF statement to determine if the person is a male or female. You do one calculation if the person is a male else you do another calculation if the person is a female.
Use a loop where you enter this data (loop for 1 to 6 ) so you will only have to run the program 1 time instead of 6 times.
m 28
m 70
m 18
f 32
f 60
f 13
For each set of data, print out the Gender, age, and Ideal Spouse's age, along with the following messages when they apply (the messages will be in the last column):
If a male over 60, print “robbing the cradle.”
If a male under 25, print “too young to be married”
if a female over 60, print “a gold digger”
if a female < 19 print “jail bait”
Plato's formula. A little bit out of date. You will be a gold digger or robbing the cradle if your age is over 40 because back then people only lived to be about 35 or so on the average.
For a male, his ideal spouse’s age is his age/2+7
For a female, her age*2-14
So, inside the loop
1. Input from the keyboard either m or f and an age
2. convert the m or f to upper or upper case
3. enter age from keyboard
4. Use an if to determine if user is a male or female. Use the appropriate syntax for your language. Calculate Ideal age.
5. Print the Gender as “Male” or as “Female”, and the age, and the ideal age you calculated.
6. Then print any matching messages on the same line
7. Accumulate the total idea age of a male spouse and of a female spouse and the count of males and females.
8. When you exit the loop the print the average idea age of a spouse for a male and the average ideal age of a spouse for a female.
if gender=="M"
do male calculation
else
do female calculation
remember two = signs for comparison
You will need braces for code blocks
In: Computer Science
Create a class called MovieReducerExtremes that implements MediaReducer. Implement a reducer that takes a movie list and an option ("newest" or "oldest"), then return the newest or oldest movie as appropriate.Submit both the MovieReducerExtremes and the Movie class from the first question.
/////Required Output:///////
Newest\n 2014 AKA Jessica Jones Action \n Oldest\n 1936 Cabaret Music \n
Given Files:
Movie.java
public class Movie extends Media {
public Movie(String name, int year, String genre) {
super(name, year, genre);
}
public String getEra() {
if (getYear() >= 2000) {
return "New Millennium Era";
} else if (getYear() >= 1977) {
return "Modern Era";
} else if (getYear() >= 1955) {
return "Change Era";
} else if (getYear() >= 1941) {
return "Golden Era";
}
return "Pre-Golden Era";
}
public boolean wasReleasedAfter(Media other) {
return getYear() > other.getYear();
}
public boolean wasReleasedBeforeOrInSameYear(Media other) {
return getYear() <= other.getYear();
}
}
Demo3.java
import java.io.FileNotFoundException;
import java.util.ArrayList;
public class Demo3
{
public static void main(String[] args) throws FileNotFoundException {
ArrayList movies = MovieLoader.loadAllMovies();
MediaReducer op = new MovieReducerExtremes();
System.out.println("Newest");
System.out.println(op.reduce(movies, "Newest"));
System.out.println("Oldest");
System.out.println(op.reduce(movies, "Oldest"));
}
}
Media.java
public abstract class Media {
private String name;
private int year;
private String genre;
public Media(String n, int y, String g) {
name = n;
year = y;
genre = g;
}
public String getName() {
return name;
}
public int getYear() {
return year;
}
public String getGenre() {
return genre;
}
public String toString() {
return String.format("%5d %-55s %-15s", year, name, genre);
}
//if the media was released on or after the year 2000, return New Millennium Era
//if the media was released on or after the year 1977, return Modern Era
//if the media was released on or after the year 1955, return Change Era
//if the media was released on or after the year 1941, return Golden Era
//in any other situation, return Pre-Golden Era
public abstract String getEra();
//return true if this media has a greater release year than the other's
public abstract boolean wasReleasedAfter(Media other);
//return true if this media was a lesser or equal release yearn than the other's
public abstract boolean wasReleasedBeforeOrInSameYear(Media other);
}
MovieLoader.java
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class MovieLoader {
public static ArrayList loadAllMovies() throws FileNotFoundException {
File f = new File("movie_list.txt");
Scanner inputFile = new Scanner(f);
ArrayList result = new ArrayList<>();
while (inputFile.hasNextLine()) {
String name = inputFile.nextLine();
int year = inputFile.nextInt();
//skip new line
inputFile.nextLine();
String genre = inputFile.nextLine();
Media m = new Movie(name, year, genre);
result.add(m);
}
return result;
}
}
MediaReducer
import java.util.ArrayList;
public interface MediaReducer {
public String reduce(ArrayList list, String key);
}
A couple from the movie_list.txt
!Next? 1994 Documentary #1 Single 2006 Reality-TV #ByMySide 2012 Drama #Follow 2011 Mystery #nitTWITS 2011 Comedy $#*! My Dad Says 2010 Comedy $1,000,000 Chance of a Lifetime 1986 Game-Show $100 Makeover 2010 Reality-TV $100 Taxi Ride 2001 Documentary $100,000 Name That Tune 1984 Game-Show $100,000 Name That Tune 1984 Music $2 Bill 2002 Documentary $2 Bill 2002 Music $2 Bill 2002 Music $2 Bill 2002 Music $2 Bill 2002 Music $25 Million Dollar Hoax 2004 Reality-TV $40 a Day 2002 Documentary $5 Cover 2009 Drama $5 Cover: Seattle 2009 Drama $50,000 Letterbox 1980 Game-Show $9.99 2003 Adventure $weepstake$ 1979 Drama ' Horse Trials ' 2011 Sport '80s Videos: A to Z 2009 Music 'Allo 'Allo! 1982 Comedy 'Allo 'Allo! 1982 War 'Conversations with My Wife' 2010 Comedy 'Da Kink in My Hair 2007 Comedy 'Da Kink in My Hair 2007 Drama 'More strasti' 2000 Romance 'Ons Sterrenkookboek' 2007 Documentary 'Orrible 2001 Comedy 'Orrible 2001 Crime 'Orrible 2001 Drama 'S ann an Ile 2009 Documentary 'Sang linggo nAPO sila 1995 Game-Show 'Sang linggo nAPO sila 1995 Musical 'T Wilhelmina 1975 Comedy 'Til Death Do Us Part 2006 Crime 'Til Death Do Us Part 2006 Drama 'Til Death Do Us Part 2006 Fantasy 'Til Death Do Us Part 2006 Romance 'Til Death Do Us Part 2006 Thriller 'Til Death 2006 Comedy 'Untold 2004 Documentary 'Wag kukurap 2004 Horror 'Way Out 1961 Drama 'Way Out 1961 Horror 'Way Out 1961 Sci-Fi 'n Shrink 2009 Comedy 't Is maar TV 1999 Comedy 't Is maar TV 1999 Game-Show 't Is maar een spel 2002 Comedy 't Is maar een spel 2002 Game-Show 't Schaep Met De 5 Pooten 1969 Comedy 't Schaep Met De 5 Pooten 2006 Comedy 't Schaep Met De 5 Pooten 2006 Drama 't Zal je gebeuren... 1998 Drama 't Zonnetje in huis 1993 Comedy (S)truth 1999 Drama + Clair 2001 Documentary + Emprendedores mi+d 2010 Documentary + Investigadores 2008 Documentary + de cin�ma 2001 Documentary + de cin�ma 2001 News ... ins Gr�ne! Das Stadt-Land-Lust-Magazin 2010 Documentary ... und basta! 2006 Comedy ... und basta! 2006 Music ... und die Tuba bl�st der Huber 1981 Comedy
In: Computer Science
Cpp challenge
Description
The purpose of this challenge is to use various flow control structures. This challenge uses techniques for displaying formatted output, simulating a payment structure for paying off outstanding debt such as a credit card or any kind of interest-bearing loan.
Requirements
cout << setw(5) << months << setw(10) << start_bal ... (of course, you can't actually use ellipses in the code. That's just an indicator that you can continue with whatever data and formatting you need)
Do Not Use
You may not use the break statement to terminate any loops
Sample Interaction / Output
What is the outstanding balance? 2000
What is the APR? 24
How much do you pay every month? 125
The table shows how long it will take to pay:
Month Start Interest Monthly End
1 2000.00 40.00 125.00 1915.00
2 1915.00 38.30 125.00 1828.30
3 1828.30 36.57 125.00 1739.87
4 1739.87 34.80 125.00 1649.66
5 1649.66 32.99 125.00 1557.66
6 1557.66 31.15 125.00 1463.81
7 1463.81 29.28 125.00 1368.09
8 1368.09 27.36 125.00 1270.45
9 1270.45 25.41 125.00 1170.86
10 1170.86 23.42 125.00 1069.27
11 1069.27 21.39 125.00 965.66
12 965.66 19.31 125.00 859.97
13 859.97 17.20 125.00 752.17
14 752.17 15.04 125.00 642.22
15 642.22 12.84 125.00 530.06
16 530.06 10.60 125.00 415.66
17 415.66 8.31 125.00 298.97
18 298.97 5.98 125.00 179.95
19 179.95 3.60 125.00 58.55
20 58.55 1.17 125.00 -65.28In: Computer Science
Give an example of a company that collects or uses data for various reasons. How can clustering or association models help the company?
In: Computer Science
Support the answers with screenshots, please
Q7) Select any TCP packet sent by the client to the server, what is the sequence number of the SYNACK segment sent to the client computer in reply to the SYN? What is the value of the Acknowledgement field in the SYNACK segment? How this to determine that value? What is it in the segment that identifies the segment as an SYNACK segment?
Q8) Are there any retransmitted segments in the trace file? What did you check for (in the trace) in order to answer this question?
In: Computer Science
need c++ format
1.Check endianness on your system
. Either Big or Little Endian
2.Convert a decimal number to 2’s complement (32bits)
E.g., 5 -> 0000 0000 0000 0000 0000 0000 0000 1001
here is the start code
*********************************************************
#include <iostream>
using namespace std;
void endianness();
void get_two_complement();
void print_menu();
int main(){
int menu;
do {
print_menu();
cout<< "Enter a number to select the menu: ";
cin >>menu;
if(menu == 1){
endianness();
}
else if (menu == 2){
get_two_complement();
}
else if (menu == 0){
break;
}
else {
printf("wrong input!!!\n");
}
print_menu();
cout<< "Enter a number to select the menu: ";
cin >> menu;
}while (menu !=0);
cout<< "Bye !!!" << endl;
exit(0);
}
void endianness(){
cout << "My system uses the following endianness..." << endl;
//write the code here
//print either little or big below
//end of code
}
void get_two_complement(){
int number;
cout << "Input the number to convert two's complement: ";
cin >> number;
cout << number << "'s two's complement is: ";
//write the code here
//end of code
cout << endl << "[format]:" << endl;
cout << number << "'s two's complement is: ";
cout << "0000 0000 0000 0000 0000 0000 0000 0000"<< endl;
}
void print_menu(){
cout << "********************************" << endl;
cout << "**** Homwwork 1: Menu ****" << endl;
cout << "* 1. Check endianness *" << endl;
cout << "* 2. Convert two's complement *" << endl;
cout << "* 0. Exit the program *" << endl;
cout << "********************************" << endl;
}In: Computer Science
Derive the recurrence for the average time complexity of Quick Sort.
In: Computer Science
Modularity
Note: The documentation you’ll be looking at for this part of the lab was written for
professional programmers, not programming novices, so it may include a number of
references to complex technical topics or details. Don’t be surprised, discouraged, or
concerned if parts of it don’t make a lot of sense right now; much of it will become clearer
as the semester progresses. For now, just do the best you can to look for information that
you can use to answer the question(s) below.
Functions also introduce the concept of modularity, where a program can be broken up
into multiple smaller pieces; each of these modules contains one or more functions that can
be used to perform a small part of the overall task (and which can be reused by other
programs). Python includes a large library of modules, each of which includes useful pre
written functions that programmers can use in their own programs with the use of an
import statement. The “Python Standard Library” Web page, available at <https://
docs.python.org/3/library/index.html>, contains a full list of these “bundled” modules (the
list starts at the “Text Processing Services” bullet point and continues until the end of the
page).
In class to date, we’ve used or made reference to three of these modules: random,
string, and math. Choose TWO of the other modules listed on the “Python Standard
Library” page. For each module:
1. Identify the name of the module and briefly summarize what general purpose it serves.
2. Select THREE functions from this module. List each function’s name and briefly
describe what it does.
3. Give an example of a type of program (real or hypothetical) for which this module is
either essential or extremely useful.
In: Computer Science
C++ programming
To store the information about a city and its weather forecast, create a struct that holds the city's name (string), population (int), and a forecast array storing 7 string elements representing the city's weather in the next 7 days.
The program will then accept user input to enter the name and population of the city, then it accepts 7 string inputs to store into the forecast array.
Then the program will output the city's name, population, and forecast data.
Ex: If the inputs are:
Houston 2313000 sunny sunny sunny rainy thunderstorm sunny sunny
the function outputs:
Houston Population: 2313000 7 Day Forecast: Day 0: sunny Day 1: sunny Day 2: sunny Day 3: rainy Day 4: thunderstorm Day 5: sunny Day 6: sunny
Your program must name the struct "city" with name, population, and forecast as the corresponding member names!
Your program must define and call this function to output the city information:
void city_info(city c)
#include <iostream>
using namespace std;
/* Define your struct here */
/* Define your printing function here */
int main() {
/* Type your code here */
return 0;
}
In: Computer Science
***** please don't copy and paste and don't use handwriting *****
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
For c++, please do not recycle other peoples code as they do not satisfy the requirements.
Write a program for sorting a list of integers in ascending order using the bubble sort algorithm.
Requirements
Implement the following functions:
Here is the content of the file data.txt.
9
8
4
7
2
9
5
6
1
3
Then reimpelment a function called bubble_sort that has the following prototype.
bubble_sort(int *array, int size, pointer to a function)
Pre condition
array - a pointer to an array of size element.
pointer to function - a pointer to a function that compares two
values (depending on sorting in ascending order or descending
order)
Post condition
Sort the array in ascending or descending based on the the pointer
to a function.
Write the main function to perform the following:
In: Computer Science
C++ Programming
Consider an input file that lists test participants in alphabetical order and their scores. Each line has the following format:
LastName FirstName score
Load the input file into an array of structs, knowing there is a maximum of 50 participants. Output to output.txt the participants with the top 5 scores, in decreasing order of scores. Each output line should have the following format:
FirstName,LastName,score
Notes:
Example input file:
Baker Alex 90 Eaves Pat 100 Kay Ivy 100 Lamar Jay 80, O'Conor Ashton 95 Saber Alice 98 Sabin Chris 89 Valdez Daniel 99 Valko Pete 92
Example output file:
Pat,Eaves,100 Ivy,Kay,100 Daniel,Valdez,99 Alice,Saber,98 Ashton,O'Conor,95
#include <iostream>
using namespace std;
struct participant
{
string fname;
string lname;
int score;
};
int main() {
/* Type your code here. */
return 0;
}
In: Computer Science
In this PYTHON 3 program assignment, you will find a text file named WorldSeries.txt. This file contains a chronological list of the World Series' winning teams from 1903 through 2018. The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2018. (Note the World Series was not played in 1904 and 1994. There are entries in the file indicating this.)
Write a program that reads this file and creates TWO dictionaries. The keys of the first dictionary are the names of the teams, and each key's associated value is the number of times the team has won the World Series. The keys of the second dictionary are the years, and each key's associated value is the name of the team that won that year.
Then display the first dictionary in a sorted one with the team won the most of times the 1st row. A sample looking could be as:
List of World Series champions:
New York Yankees : 26 Times
St. Louis Cardinals : 11 Times
Boston Red Sox : 7 Times
New York Giants : 5 Times
Pittsburgh Pirates : 5 Times
Philadelphia Athletics : 5 Times
Cincinnati Reds : 5 Times
Los Angeles Dodgers : 5 Times
Detroit Tigers : 4 Times
Oakland Athletics : 4 Times
Chicago White Sox : 3 Times
…
The program should then prompt the user to enter a year in the range of 1903 through 2018. It should then display the name of the team that won the World Series that year, and the number of times that team has won the World Series. The program should allow a user to play multiple times. Remind user how to terminate the program.
Tips:
Text file titled: WorldSeries_1903_2018.txt
contents include:
Boston Americans World Series Not Played in 1904 New York Giants Chicago White Sox Chicago Cubs Chicago Cubs Pittsburgh Pirates Philadelphia Athletics Philadelphia Athletics Boston Red Sox Philadelphia Athletics Boston Braves Boston Red Sox Boston Red Sox Chicago White Sox Boston Red Sox Cincinnati Reds Cleveland Indians New York Giants New York Giants New York Yankees Washington Senators Pittsburgh Pirates St. Louis Cardinals New York Yankees New York Yankees Philadelphia Athletics Philadelphia Athletics St. Louis Cardinals New York Yankees New York Giants St. Louis Cardinals Detroit Tigers New York Yankees New York Yankees New York Yankees New York Yankees Cincinnati Reds New York Yankees St. Louis Cardinals New York Yankees St. Louis Cardinals Detroit Tigers St. Louis Cardinals New York Yankees Cleveland Indians New York Yankees New York Yankees New York Yankees New York Yankees New York Yankees New York Giants Brooklyn Dodgers New York Yankees Milwaukee Braves New York Yankees Los Angeles Dodgers Pittsburgh Pirates New York Yankees New York Yankees Los Angeles Dodgers St. Louis Cardinals Los Angeles Dodgers Baltimore Orioles St. Louis Cardinals Detroit Tigers New York Mets Baltimore Orioles Pittsburgh Pirates Oakland Athletics Oakland Athletics Oakland Athletics Cincinnati Reds Cincinnati Reds New York Yankees New York Yankees Pittsburgh Pirates Philadelphia Phillies Los Angeles Dodgers St. Louis Cardinals Baltimore Orioles Detroit Tigers Kansas City Royals New York Mets Minnesota Twins Los Angeles Dodgers Oakland Athletics Cincinnati Reds Minnesota Twins Toronto Blue Jays Toronto Blue Jays World Series Not Played in 1994 Atlanta Braves New York Yankees Florida Marlins New York Yankees New York Yankees New York Yankees Arizona Diamondbacks Anaheim Angels Florida Marlins Boston Red Sox Chicago White Sox St. Louis Cardinals Boston Red Sox Philadelphia Phillies New York Yankees San Francisco Giants St. Louis Cardinals San Francisco Giants Boston Red Sox San Francisco Giants Kansas City Royals Chicago Cubs Houston Astros Boston Red Sox
In: Computer Science
To store the information about a city and its weather forecast, create a struct that holds the city's name (string), population (int), and a forecast array storing 7 string elements representing the city's weather in the next 7 days.
The program will then accept user input to enter the name and population of the city, then it accepts 7 string inputs to store into the forecast array.
Then the program will output the city's name, population, and forecast data.
Ex: If the inputs are:
Houston 2313000 sunny sunny sunny rainy thunderstorm sunny sunny
the function outputs:
Houston Population: 2313000 7 Day Forecast: Day 0: sunny Day 1: sunny Day 2: sunny Day 3: rainy Day 4: thunderstorm Day 5: sunny Day 6: sunny
Your program must name the struct "city" with name, population, and forecast as the corresponding member names!
Your program must define and call this function to output the city information:
in c++
In: Computer Science