Questions
, you will be writing a simple calculator program that gets input from the user, does...

, you will be writing a simple calculator program that gets input from the user, does some calculation, and outputs the results to the user. Your program must have at least one input and at least one output, but you can choose the type of calculator you want to write. Some examples are:

Converting Celsius to Fahrenheit,

In: Computer Science

Solve the following programming problems using object-oriented programming in Java. Provide the problem code and screenshot...

Solve the following programming problems using object-oriented programming in Java. Provide the problem code and screenshot of the test run.

COIN TOSSING: Write a program that simulates the toss of a coin. Provide a menu of two options: toss and quit. Count the number of times each side of the coin appears and display the results after each toss. The program should have a method called flip() that is called, takes no arguments and returns a Coin enum value (HEADS or TAILS).

GUESS THE NUMBER: Write a program that plays a game of guess the number. Generate a random integer between 1 and 500. When the player inputs a number, evaluate if the number is too low or too high and let the user know. When the user guesses the number correctly, display how many tries it took for the user to correctly guess the number.

Create a method that receives the guess number as a parameter and returns true if the user guessed the number correctly and false if the user hasn’t guessed the number. The evaluation of high or low should occur in the method.

You can pass the value of the randomly generated number to the method or declare it as static before the main method.

In: Computer Science

(MIS CHAPTER 6 PAGE 162 QUESTION 1) using your knowledge of this chapter and the intuition...

(MIS CHAPTER 6 PAGE 162 QUESTION 1) using your knowledge of this chapter and the intuition of the members of your team summarize the threats that cloud services present to ISVS

In: Computer Science

Virtualization technology is fundamental in enabling the development and operation of cloud computing services. It has...

Virtualization technology is fundamental in enabling the development and operation of cloud computing services. It has evolved quite rapidly. These days, we are not only virtualizing desktops and servers but also networks and even entire data centers.

In this discussion, discuss the relative advantages and disadvantages of virtualization, particularly as it relates to enterprise networking and cloud computing. Ideally, you will speak from your own professional experience. If you do not have any professional experience related to virtualization technology, then base your discussion on your own research and be sure to include citations.

In: Computer Science

Voyager SkyGazer Software The directions for this lab assumes the Voyager SkyGazer Software is installed on...

Voyager SkyGazer Software The directions for this lab assumes the Voyager SkyGazer Software is installed on your computer for this exercise. It has been done using different software, in particular apps for the iPhone. Question 12 may give you problems as some software won’t allow you to go back in time 2000 years. If your chosen software has this limitation, try a different internet package. If you are using a different software program, explain what “button” you need to push to accomplish the following tasks. We will explore the Voyager software package. It will allow you to see the “sky” change in a matter of minutes, changes that would take many years in the real sky. Our approach will be to present a problem or task that will require you to modify the program settings. You will then need to answer questions and submit them as your report. If you are faxing or mailing the report to me, you must include the coversheet so your work will be routed to me. Part 1: Setting time, direction of viewing and location. On the top menu, locate “Chart”; it is the third option from the left. Click “Chart” and a dropdown menu opens. The first option is “Set Time”; the second option is “Set Location”. Select “Set Location”. A scroll menu of locations appears on the left of the Set Location Box. Find and select San Francisco. Later, you can play with other locations. We want to be able to change the direction we are looking in Voyager’s sky. There are three ways of changing the view direction. First, on the top menu find “Center” to the right of “Chart”. Click “Center” and then chose your direction. Let’s look South. Another way is to use the slide bar at the bottom of the screen. Put the mouse pointer on the slide bar, hold down the left mouse button, and move the slider to the right. You will see a compass appear, indicating your viewing direction. Again, select South. Finally, you can put the mouse pointer on the sky, hold down the left mouse button, and simply drag the sky to where you want to look. Notice the mouse pointer changes to a hand when you move the sky. If you are looking south and see mostly “ground”, you can either move the slider at the right of the screen or, by holding the left mouse button down, drag the display to show more sky. Depending on when you are doing this exercise, you may have a day or a night sky. Let’s change the date and time by clicking the “Chart” option on the top menu and then selecting “Select Time”. Much ado was made about the world ending, according to the Mayan Calendar, on December 21st, 2012 due to a planetary alignment. Let’s see if the planets were aligned on this date. Let’s pick a time of 10:00 p.m. on December 21st, 2012. Enter this time into the Select Time Box. Remember, you need to be looking south.

Close all boxes on the screen except the “Time” box

Question 1: Were the planets aligned on December 21, 2012? If the planet labels are not shown, select “Display” on the top menu, then on the drop down select “labels” and make sure there is a check besides “planets”. If there is not a check, simply click on “planets”. An alignment means the planets appear together as a single object. They are always found on a path going west to east across the sky.

Question 2: In the sky, we can see at most 7 planets – we are standing on one of the planets, Earth, so we don’t see it in the sky! Remember, Pluto is not a planet! Let’s see where the planets are in the night sky. Not all the planets may be in the night sky. Change the viewing time to 5:00 p.m. by using the “Select Time” option. Again, you are looking south. Describe the order of the planets, Sun, and Moon on the ecliptic. The Sun is not visible but deduce where it must be.

Question 3: In the “Time” box open on the screen, change the “Step” to 5 minutes by clicking at the right of the Step row. Now click “Start”. Notice the sky changes as does the clock in the “Time” box. If you click “Stop”, you can stop the change of time. The other options in the same row as the “Start” button control the motion of the sky as well. What do the other four options in the Start row do?

Question 4: Let’s find in which constellations the Sun, Moon, and planets are. Place the mouse pointer near a planet (or Moon or Sun) and left mouse click. Another box should open, listing where the pointer is. For each object, record its constellation. To see all the objects, you will need to click on the Start and Stop buttons several times.

Question 5: During the night of December 21st, 2012, did the planets ever align?

Question 6: What is your explanation for your answer to Question 5?

Question 7: Reset the time back to 5:00 p.m. on December 21st, 2012. Using a step time of 5 minutes (you should not need to change this), click on “Start” in the Time Box. Describe the movement of the stars over the course of the night.

Question 8: It is said the stars rise in the east and set in the west. Discuss this statement using your observations for Question 7. Change the cardinal points (north/south/east/west).

Question 9: Now change your viewing time to 4:00 a.m. and your viewing direction to east. Leaving the step time at 5 minutes, click on “Start” in the Time Box. Click on “Stop” when you see the Sun rise. At what time did the Sun rise?

Question 10: By moving the slider at the bottom of the screen, center the Sun on the screen so it is half way between the left side of the screen and the right side. With the mouse button held down on the slider, note the direction indicated by the compass. Does the Sun always rise in the east? Justify your answer. Make large changes in the date before committing to your answer.

Question 11: Now change the Time Step to “1 day” by clicking at the right side of the Step row in the Time Box. Click the “Start” and observe the Sun for a year (by program time!). Describe the movement of the Sun.

Question 12: Look at these websites – http://www.versebyverse.org/doctrine/birthofchrist.html. http://www.themoorings.org/apologetics/chronology/Chrmas.html http://www.msnbc.msn.com/id/3077385/

By changing the location to Mideast and then Jersalem, you can investigate each of these articles in terms of the astronomy impact on the stories. You will need to make a major time change – over 2000 years! Does your investigation support or contradict the articles? I am not referring to the religious aspect of the articles; stay focused on the astronomy mentioned in the articles. Justify your response.

Question 13: Play with some of the other features (your choice!) of Voyager. Describe what you did with each action and how it changed the display. What did you learn with your selfdirected investigation?

In: Computer Science

In formal terms, a monitor is an object which only allows one of its methods to...

In formal terms, a monitor is an object which only allows one of its methods to be executed at once.

For Java:

1) How could you implement a class satisfying the monitor’s fundamental mutual exclusion property – that is, a class whose instantiated objects ensured mutual exclusion among their methods? Provide a code fragment as an example.

2) Could you mutually exclude critical sections smaller than an entire method without resorting to mutex locks? If so, how?

3) How would you implement condition variables as we described them in class? Provide a code fragment as an example.

4) Does the implementation differ if you need more than one condition variable? If so, how?

In: Computer Science

Matlab: When I plot "figure (3)", I would like it to produce three lines/curves instead of...

Matlab: When I plot "figure (3)", I would like it to produce three lines/curves instead of data points. Currently, the code will only produce a plot when I use characters and symbols. Please help...

%-------------------------------------------------------------------------------------------------------------%

clear all

close all

clc

xmax=1;

ne=100;

nx=ne+1;

dx=xmax/ne;

dxdx=dx+dx;

dx2=dx*dx;

dt=0.02;

%-------------------------------------------------------------------------------------------------------------%

for i=1:nx

u(i)=0;

bvec(i)=0;

end

u=u';

bvec=bvec';

amat(1,1)=1;

for i=2:nx-1

amat(i,i)=(2/dx2)+(1/dt);

amat(i,i-1)=-(1/dx2);

amat(i,i+1)=-(1/dx2);

end

amat(nx,nx)=1;

av=inv(amat);

for it=1:100

zt(it)=(it-1)*dt;

bvec(1)=-exp(-(zt(it)-0.5)^2/0.03);

for j=2:nx-1

bvect(j)=(u(j)/dt)+(1/2*u(j));

end

bvec(nx)=zt(it)*(sin(4*zt(it)))^4;

u=av*bvec;

for j=1:nx

out(it,j)=u(j);

end

end

%-------------------------------------------------------------------------------------------------------------%

figure(1)

mesh(out)

xlabel('X')

ylabel('Time')

zlabel('Temperature')

title('Temperature as a Function of Time and Space')

%-------------------------------------------------------------------------------------------------------------%

figure(2)

pcolor(out)

xlabel('X')

ylabel('Time')

title('Temperature as a Function of Time and Space')

%-------------------------------------------------------------------------------------------------------------%

figure(3)

for k=1:ne

plot(zt(k),out(k,1),'r*')

hold on

plot(zt(k),out(k,31),'b*')

hold on

plot(zt(k),out(k,61),'g*')

hold on

end

title('Time History of Temperature at Different Locations')

xlabel('Time')

ylabel('Temperature')

legend('x=0.0','x=0.3','x=0.6')

In: Computer Science

C++ program, include comments stating what each part of code does please. I want to be...

C++ program, include comments stating what each part of code does please. I want to be able to understand it so I'll be more knowledgeable in the future. The program is multiple files(transcribe_dna_to_rna.h file, transcribe_dna_to_rna.cpp file, main.cpp file and loops_strings_test.cpp). After the directions I also included any starter code or comments left by my professor within the files to aide us.

Directions:

In folder 05_loops_strings write prototype and definition for string value - return function transcribe_dna_into_rna with a string parameter that returns the rna string. Write the required unit test(s) in folder 05_loops_strings_test. Main program flow: No loop. Use the given string as function argument call transcribe_dna_into_rna function and display the output.

transcribe_dna_to_rna.h

/*
Create a function transcribe_dna_into_rna with a dna const reference string parameter that returns a string.
*/

transcribe_dna_to_rna.cpp

//Write include statements
/*
An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'.
Given a DNA string t corresponding to a coding strand, its transcribed RNA string u is formed by replacing
all occurrences of 'T' in t with 'U' in u.
Given: A DNA string
Return: The transcribed RNA string of the DNA string
Examle:
dna_string: GATGGAACTTGACTACGTAAATT
transcribe_dna_into_rna("GATGGAACTTGACTACGTAAATT");
returns:
GAUGGAACUUGACUACGUAAAUU
*/

main.cpp

//Write include statements
//Write using statements
/*
No loop.
Use the string "GATGGAACTTGACTACGTAAATT" call the transcribe_dna_into_rna function and display the result
*/
int main()
{
return 0;
}

loops_strings_test.cpp

#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "catch.hpp"
//Write include statements
/*
Write test case for transcribe dna to rna with string:
"GATGGAACTTGACTACGTAAATT" returns GAUGGAACUUGACUACGUAAAUU
*/

In: Computer Science

Define a class named Payment that contains an instance variable "paymentAmount" (non-static member variable) of type...

Define a class named Payment that contains an instance variable "paymentAmount" (non-static member variable) of type double that stores the amount of the payment and appropriate accessor (getPaymentAmount() ) and mutator methods. Also create a method named paymentDetails that outputs an English sentence to describe the amount of the payment. Override toString() method to call the paymentDetails() method to print the contents of payment amount and any other details not included in paymentDetails().

Define a class named CashPayment that is derived from Payment. This class will have an additional instance variable of type String (a non-static member variable) that specifies a type of currency, such as "dollar", "euro", "peso", "yen", etc. This class should override the paymentDetails method to indicate that the payment is in cash, and the type of currency used. Include appropriate constructor(s)  and accessor/mutator methods for all instance variablesand. Override toString() with contents of cash payment details (should still call paymentDetails()).

Hello folks, i need some JAVA help here.

Define a class named CreditCardPayment that is derived from Payment. This class should contain instance variables (member variables) for the name on the card, expiration date, and credit card number. Include appropriate constructor(s) and accessor/mutator methods for all instance variables. Finally, redefine thepaymentDetails method to include all credit card information in the printout.  Override toString() method with contents of credit payment details (should still call paymentDetails()).

Create a main method within Payment that creates at least two CashPayment and two CreditCardPayment objects with different values and payment amounts. Call toString() methods from each object to print the details of each payment.

In: Computer Science

Please code the following prompt in python. Today you will be building a movie/actor lookup. The...

Please code the following prompt in python.

Today you will be building a movie/actor lookup. The data structure that will power your lookups will be a dictionary which maps movies (as strings) to a list of actors (you may also use a set if you prefer). You will also add features such as finding the most common actor in a data set, or the movies that two actors have been in.

The first function you should write is add_or_update_a_movie. This function takes the movie dictionary, a movie, and a list of actors. You will need this for all other functions, so complete this feature first. If a movie is added that doesn't exist in the dictionary yet, make a new entry. If it does exist, the list of actors should be added to the current list of actors, with no actors repeated.

All of the other functions in movies.py are explained in the documentation. The last function is for extra credit and will require some knowledge of recursive functions.

Incorporate a function that should have the signiture

def degrees_between(movie_dict, actor1, actor2):

and uses the following file to open and create a dictionary:

https://s3.amazonaws.com/mimirplatform.production/files/a5dac972-8c2d-4565-95be-4b036cb08e7b/movies_large.txt

In: Computer Science

In the context of software reliability and statistical testing: (a) Define operation profile and (b) Where...

In the context of software reliability and statistical testing: (a) Define operation profile and (b) Where or how can we obtain this information?

In: Computer Science

How to add and multiply two matrices in the following code? #include "My_matrix.h" #include <stdexcept> My_matrix::My_matrix()...

How to add and multiply two matrices in the following code?

#include "My_matrix.h"

#include <stdexcept>

My_matrix::My_matrix()

{

// add your code here

n = 0;

m = 0;

ptr = nullptr;

}

void My_matrix::allocate_memory()

{

// add your code here

ptr = new int* [n];

for (int i = 0; i < n; ++i) {

ptr[n] = new int[m];

}

}

My_matrix::My_matrix(int n1, int m1)

{

// add your code here

n = n1;

m = m1;

ptr = new int*[n];

for(int i = 0; i < n; i++) {

ptr[i] = new int[m];

}

for (int i = 0; i < n; i++) {

for (int j = 0; j < m; j++) {

ptr[i][j] = 0;

}

}

}

My_matrix::My_matrix(const My_matrix& mat)

{

// add your code here

this->n = mat.n;

this->m = mat.m;

ptr = new int*[n];

for(int i = 0; i < n; i++) {

ptr[i] = new int[m];

}

for (int i = 0; i < mat.n; i++) {

for (int j = 0; j < mat.m; j++) {

this->ptr[n][m] = mat.ptr[n][m];

}

}  

}

My_matrix::~My_matrix()

{

// add your code here

for (int i = 0; i < n; ++i) {

delete [] ptr[i];

}

delete [] ptr;

}

My_matrix& My_matrix::operator=(const My_matrix& mat)

{

// add your code here

   this->n = mat.n;

this->m = mat.m;

ptr = new int*[n];

for(int i = 0; i < n; i++) {

ptr[i] = new int[m];

}

for (int i = 0; i < mat.n; i++) {

for (int j = 0; j < mat.m; j++) {

this->ptr[n][m] = mat.ptr[n][m];

}

}

   }

int My_matrix::number_of_rows() const

{

// add your code here

return n;

}

int My_matrix::number_of_columns() const

{

// add your code here

return m;

}

int* My_matrix::operator()(int i) const

{

// add your code here

return ptr[i];

}

int My_matrix::operator()(int i, int j) const

{

// add your code here

   return ptr[n][m];

}

int& My_matrix::operator()(int i, int j)

{

// add your code here

return ptr[n][m];

}

int My_matrix::elem(int i, int j) const

{

if (i < 0 || i >= n) throw out_of_range("Out of range");

if (j < 0 || j >= m) throw out_of_range("Out of range");

// add your code here

return ptr[n][m];

}

int& My_matrix::elem(int i, int j)

{

// add your code here

if (i < 0 || i >= n) throw out_of_range("Out of range");

if (j < 0 || j >= m) throw out_of_range("Out of range");

return ptr[n][m];

}

ostream& operator<<(ostream& out, const My_matrix& mat)

{

// add your code here

for (int i = 0; i < mat.number_of_rows(); i++) {

for (int j = 0; j < mat.number_of_columns(); j++) {

out << mat(i, j) << " ";

}

out << endl;

}

return out;

}

istream& operator>>(istream& in, My_matrix& mat)

{

// add your code here

for(int i = 0; i < mat.number_of_rows(); i++ ){

for(int j = 0; j < mat.number_of_columns(); j++){

in >> mat(i, j);

}

}

return in;

}

My_matrix operator+(const My_matrix& mat1, const My_matrix& mat2)

{ // add your code here

}

My_matrix operator*(const My_matrix& mat1, const My_matrix& mat2)

{

// add your code here

}

In: Computer Science

Draw diagram building structure wuth 4 floors for hcc, vcc, mdf, and idf

Draw diagram building structure wuth 4 floors for hcc, vcc, mdf, and idf

In: Computer Science

HW_7d -   Cat class Create 3 files: Cat.h Include a class specification for a Cat class...

HW_7d -   Cat class

Create 3 files:

  1. Cat.h
    • Include a class specification for a Cat class
    • Data members include:
      • A cat’s weight
      • A cat’s color
  • Member functions (methods) include:
    • A function called setWeight, to set the cat’s weight
    • A function called setColor, to set the cat’s color
    • A function called displayInfo, that displays a cat’s age and weight on the screen
    • A function called meow, that lets the cat say “Meow” on the screen

  1. Cat.cpp
    • Include the method implementations for the four functions in this file
  1. Source.cpp
    • Include main()
      • In main(), declare three cats (3 cat objects)
      • Name them: Fluffy, Tom, and Kitty

  • Ask the user to describe Fluffy (get Fluffy’s weight and color)
  • Fluffy (the Fluffy object) calls setWeight to pass the weight to the method, where

    the weight is assigned to Fluffy’s weight.

  • Fluffy (the Fluffy object) calls setColor to pass the color to the method, where

    the color is assigned to Fluffy’s color

  • Repeat the above for the Tom and Kitty objects.

  • Have each of the Cat objects call the DisplayInfo method to output the age and color

   of each cat.

  • Have each cat say “MEOW” on the screen by having each Cat object call the

     meow method.

/* OUTPUT:

So you have three cats...

Describe Fluffy. What does she weight? 4

What color is she? brown

Describe Tom. What does he weight? 9

What color is he? orange

Describe Kitty. What does she weight? 5

What color is she? white

Fluffy weights 4 pounds and is brown.

Tom weighs 9 pounds and is orange.

Kitty weighs 5 pounds and is white.

Fluffy says: MEOW!

Tom says: MEOW!

Kitty says: MEOW!

Press any key to continue */

Code Language: C++

Please add comments for each code.

In: Computer Science

(Package Inheritance Hierarchy) Package-delivery services, such as FedEx®, DHL® and UPS®, offer a number of different...

(Package Inheritance Hierarchy) Package-delivery services, such as FedEx®, DHL® and UPS®, offer a number of different shipping options, each with specific costs associated. Create an inheritance hierarchy to represent various types of packages. Use class Package as the base class of the hierarchy, then include classes TwoDayPackage and OvernightPackage that derive from Package.

Base-class Package should include data members representing the name, address, city, state and ZIP code for both the sender and the recipient of the package, in addition to data members that store the weight (in ounces) and cost per ounce to ship the package. Package’s constructor should initialize these data members. Ensure that the weight and cost per ounce contain positive values. Package should provide a public member function calculateCost that returns a double indicating the cost associated with shipping the package. Package’s calculateCost function should determine the cost by multiplying the weight by the cost per ounce.

Derived-class TwoDayPackage should inherit the functionality of base class Package, but also include a data member that represents a flat fee that the shipping company charges for two-day-delivery service. TwoDayPackage’s constructor should receive a value to initialize this data member. TwoDayPackage should redefine member function calculateCost so that it computes the shipping cost by adding the flat fee to the weight-based cost calculated by base class Package’s calculateCost function.

Class OvernightPackage should inherit directly from class Package and contain an additional data member representing an additional fee per ounce charged for overnight-delivery service. OvernightPackage should redefine member function calculateCost so that it adds the additional fee per ounce to the standard cost per ounce before calculating the shipping cost. Write a test program that creates objects of each type of Package and tests member function calculateCost.

please send a link to a repl.it file to help find the solution or separate the files with names so I can know different header files to use

use c++

In: Computer Science