Write a program to demonstrate the use of InetAddress. The program takes a list of names or IP addresses as command line parameters and prints the name and an IP address of the local host, followed by names and IP addresses of the hosts specified on the command line. use java program
In: Computer Science
You want to implement Radix Sort to sort a large set of random numbers using an auxiliary sorting algorithm for the digits and you want your algorithm to be fast. Which auxiliary sorting algorithms would you use?
1. Heap Sort
2. Merge Sort
3. Insertion Sort
4. Selection Sort
5. Basic Quick Sort
In: Computer Science
Like a TCP server, a UDP server's job is to set up a communication endpoint and passively waits for the client to initiate the communication; however, since UDP is connectionless, UDP communication is initiated by a datagram from the client, without going through a connection setup as in TCP.
Write a program to demonstrate the typical UDP server goes through the following four steps:
1. Construct an instance of DatagramSocket, specifying the local port and, optionally, the local address.
2. Receive an instance of DatagramPacket using the receive() method of DatagramSocket. When receive() returns, the datagram contains the client's address so we know where to send the reply.
3. Communicate by sending and receiving DatagramPackets using the send() and receive() methods of DatagramSocket.
4. When finished, deallocate the socket using the close() method of DatagramSocket.
Note: The program is very simple: it loops forever, receiving datagrams and then sending the same datagrams back to the client. Actually, your server only receives and sends back the first 255 (ECHOMAX) characters of the datagram; any excess is silently discarded by the socket implementation
In: Computer Science
Draw the corresponding ERD for the following Employee Database:
Employee (emp_id, first_name, middle_name, last_name, date_of_birth)
Dept (Dept_id, Dept_name, Building)
works (emp_id, dept_id, hours)
Emp_phone (emp_id, phone_num)
Note:
Please I need a short answer only on paragraph and simple words.
In: Computer Science
In: Computer Science
In your own word, explain why do designers use Denormalization? What is the limitation of using Denormalization? Name and explain a better alternative approach than Denormalization.
Note:
Please I need a short answer only on paragraph and simple words.
In: Computer Science
1. Compute 312 mod 12
2. Find the multiplicative inverse of 7 in Z19 (i.e., mod 19)
Please show your work and thank you
In: Computer Science
A prime number is a number that is only evenly divisible by itself and 1. For example, the number 5 is prime because it can only be evenly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6. Write a Boolean function named is_prime which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Use the function in a program that displays all of the prime numbers from 1 to 100. The program should have a loop that calls the is_prime function.
In: Computer Science
C++ Program for Project Alarm.
------------------------------------------------------------------------------
Fix ALL Errors in my EXISTING code for ALL 5 files.
MUST add comments for FULL CREDIT.
Take a screenshot of the working solution output.
-------------------------------------------------------------------------------
Instructions:
Use class composition to define and implement a new class called Alarm that contains a Time member variable.
A. Define and implement the class Alarm as follows: The class Alarm consists of two private member variables:
description of type string and atime of type Time. The class Alarm also includes the following public
member functions:
- print to print out the alarm’s description and hour, minute, and second of the alarm time.
- setDescription to accept a string argument and use it to set the description member variable.
-setAtime to accept three integers (for hour, minute, and second) to set the atime member variable
(alarm time).
- getDescription to return the value of the description member variable.
- getAtime to return the atime member as a Time object.
- A default constructor that initializes the description to the string “None” and the alarm time to
00:00:00.
- An overloaded constructor that accepts a string argument for the alarm description and three int arguments
(as the hour, minute, and second) and use them to initialize the description and atime member
variables of an Alarm object.
- An overloaded constructor that accepts a string argument for the alarm description and a Time object and
use them to initialize the description and atime member variables of an Alarm object.
- An equals function to compare two Alarm objects’ values. Return true if both objects have the same
values of the member variables. Otherwise, return false.
B. In the function main, write statements to declare Alarm class objects and test your class implementation.
Hint: (Time.h, Time.cpp, Alarm.h, Alarm.cpp, Main.cpp.)
-------------------------------------------------------------------------------------
Note:(Detailed comments are helpful for me so I can better
understand where I went wrong. So please be detailed.
Edit my code so it works, but do not add highly advanced code.)
------------------------------------------------------------------------------------
MY CODE:
-------------------------------------------------------------------------------------
//////////////////////////////////// Time.h ///////////////////////////////////////////
#include<iostream>
using namespace std;
class Time
{
private:
int hour;
int minute;
int second;
public:
/* Constructors */
Time(); //Default constructor
Time(int h, int m, int s); //Overloaed
Constructor
Time(const Time&);
/* Functions */
void print(); // Print the Time
int getHour(); //Accessor function
int getMinute(); //Accessor function
int getSecond(); //Accessor function
void setHour(int h); //Mutator change Hour
void setMinute(int m); //Mutator Change Minute
void setSecond(int s); //Mutator Change Second
void setTime(int h, int m, int s); //Overloaded
Constructor
bool equals(const Time&)const;
};
////////////////////////////////END OF Time.h/////////////////////////////////////
//////////////////////////////////// Time.cpp ////////////////////////////////////////
#include "Time.h"
#include "Alarm.h"
#include<iomanip>
using namespace std;
void Time::print()
{
cout << setw(2) << setfill('0') << hour <<
":"
<< setw(2) << setfill('0') << minute <<
":"
<< setw(2) << setfill('0') << second <<
endl;
}
// Default Constructor
Time::Time()
{
hour = 0; minute = 0; second = 0;
}
// copy Constructor
Time::Time(const Time& other) {
hour = other.hour;
minute = other.minute;
second = other.second;
}
// Accessor for Hour
int Time::getHour()
{
return hour;
}
// Accessor for Minute
int Time::getMinute()
{
return minute;
}
// Accessor for Second
int Time::getSecond()
{
return second;
}
// Mutator for Hour
void Time::setHour(int h)
{
// Validate Hour value
if (h >= 0 && h <= 23)
hour = h;
else
hour = 0;
}
// Mutator for Minute
void Time::setMinute(int m)
{
// Validate Minute value
if (m >= 0 && m <= 59)
minute = m;
else
minute = 0;
}
// Mutator for Second
void Time::setSecond(int s)
{
if (s >= 0 && s <= 59)
second = s;
else
second = 0;
}
// Set Time function
void Time::setTime(int h, int m, int s)
{
setHour(h);
setMinute(m);
setSecond(s);
}
Time::Time(int h, int m, int s)
{
setTime(h, m, s);
}
bool Time::equals(const Time& other)const
{
return hour == other.hour && minute == other.minute
&& second == other.second;
}
////////////////////////////////END OF Time.cpp/////////////////////////////////
//////////////////////////////////// Alarm.h //////////////////////////////////////////
#include<iostream>
using namespace std;
class Alarm
{
private:
string description;
Time atime;
public:
/* Constructors */
void print();
void setDescription(string i);
void setAtime(int h, int m, int s);
Time getAtime();
void getDescription(); // Accessor Function
Alarm() {description = "None";}
Alarm(string i, int h, int m, int s);
};
//////////////////////////////// END OF Alarm.h /////////////////////////////////
/////////////////////////////////// Alarm.cpp //////////////////////////////////////
#include "Time.h"
#include "Alarm.h"
#include<iomanip>
using namespace std;
void Alarm::print()
{
cout << description << "";
atime.print();
}
void Alarm::setDescription(string i)
{
description = i;
}
void Alarm::setAtime(int h, int m, int s)
{
atime.setTime(h, m, s);
}
Time Alarm::getAtime()
{
return atime;
}
void Alarm::getDescription()
{
}
Alarm::Alarm()
{
description = "None";
}
Alarm::Alarm(string desc, int hour, int minute, int second) :
atime(hour, minute, second)
{
description = desc;
}
bool Alarm::equals(const Alarm& other)
{
return atime.equals(other.atime) &&
description == other.description;
}
//////////////////////////////// END OF Alarm.cpp ////////////////////////////
//////////////////////////////////// Main.cpp /////////////////////////////////////////
// I didn't write the main.
// complete the main.
/////////////////////////////////// END OF Main.cpp ////////////////////////
------------------------------------------------------------------------------------------------------------
Thank you.
In: Computer Science
USE C++ for following problem and also use create full program that takes input from user also do not use loops only recursion and try to keep program simple
A palindrome is any word, phrase, or sentence that reads the same forwards or backwards. Here are some palindromes: Level Civic Pot top A man a plan a canal Panama Write a boolean function that determines if a string argument is a palindrome. The function should return true if the argument reads the same forwards and backwards. Your function should ignore spaces and be case-insensitive. Assume the input is just letters and spaces.
In: Computer Science
In: Computer Science
we list a multiple hot technologies related to distributed systems/computing. Students need to write a paragraph on ALL the below topics
What is Client Server model?
Compare and contrast centralized and distributed computing.
Explain Servers, Clients, Thread, Code Migration, Software agents for the same. What is a process? Explain the various states of a process through state transition diagram.
Explain the layered protocols. Compare and contrast the OSI and TCP/IP model. What is spontaneous networking?
Compare and contrast some of the network and distributed simulation tools.
Explain the trends in large scale distributed systems simulation tools.
In: Computer Science
4. Identify and discuss a strategy that could be used to manage contractors during outsourcing of IT services [25 Marks]
In: Computer Science
In: Computer Science
Write a C++ program that reads in a table of numbers and finds out the average of each row and column. This program should first take two numbers as number of rows and columns as input from the user
In: Computer Science