In: Computer Science
Write a program that prompts the user to enter a 3 x 3 matrix of double values and tests whether it is a positive Markov matrix. There will be two methods which will be called from the main method: public static double [] [] createArray() 1. Creates a 3 by 3 two dimensional array of doubles 2. Prompts the user for values as shown in the sample run 3. Stores the numbers in the array in the order entered 4. Returns the array to the main method public boolean isMarkovMatrix(double [][] matrix) 1. Returns false if any value in the array is negative 2. Prints the sum of each column in the array 3. Returns false if any the sum of any of the columns is not equal to 1.0 4. Otherwise, it returns true. Sample Program running: Enter a 3 x 3 matrix by row 0.15 0.875 0.375 0.55 0.005 0.225 0.30 0.12 0.4 The sum of the columns 1.0 1.0 1.0 It is a Markov matrix Enter a 3 x 3 matrix by row -0.2 0.875 0.375 0.75 0.005 0.225 0.45 0.12 0.4 The sum of the columns 1.0 1.0 1.0 It is not a Markov matrix The program must display the sum of EACH INDIVIDUAL column A response in Eclipse Java would be much appreciated. Thank you in advance
In: Computer Science
Must make a "Calculator" using C. The calculator must subtract, add, divide, and multiply inputs, and tell whether a number is prime or not. The user chooses how many inputs go into the calculator.
For example, the code will ask the user what function they want. If the user chooses to subtract, the the code will then ask the user how many numbers they want to subtract. After, the code will ask the user to input as many numbers as they chose in the last step. Lastly, the code must subtract the first input - the second input - the third input and so on, and must print the answer.
In: Computer Science
in c code
For example, a sample execution of your code would be as follows:
Cookie Corner! (name it whatever you want)
Please enter your first name.
Jane
Jane, what type of cookie would you like to order?
1
You selected a SUGAR cookie. How many cookies would you like?
4
Jane, your total cost is $1.00
Would you like to order another type of cookie?
No
Thanks for ordering!
In: Computer Science
In Chapter 4 of your book, you created an interactive application named MarshallsRevenue that prompts a user for the number of interior and exterior murals scheduled to be painted during a month and computes the expected revenue for each type of mural. The program also prompts the user for the month number and modifies the pricing based on requirements listed in Chapter 4.
Now, modify the program so that the user must enter a month value from 1 through 12. If the user enters an incorrect number, the program prompts for a valid value. Also, the user must enter a number between 0 and 30 inclusive for the number of murals of each type; otherwise, the program prompts the user again.
Below is the source code
using System;
class MainClass
{
public static void Main (string[] args) //main function
{
//variable declaration
int month,intmu,extmu,total;
total=0;
string[] arr = new string[] {"January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November", "December"};
do
{
//accepting the month value from user
Console.WriteLine ("Enter a month number");
month = Convert.ToInt32(Console.ReadLine());
if(month<1 || month >12)
Console.WriteLine ("Enter a valid value between 1 to 12");
}while(month<1 || month >12);
do
{
//accepting interior mural number from user
Console.WriteLine ("Enter number of interior murals");
intmu = Convert.ToInt32(Console.ReadLine());
if(intmu < 0 || intmu >30)
Console.WriteLine ("Enter a valid value between 0 to 30");
}while(intmu < 0 || intmu >30);
do
{
//accepting exterior mural number from user
Console.WriteLine ("Enter number of exterior murals");
extmu = Convert.ToInt32(Console.ReadLine());
if(extmu < 0 || extmu >30)
Console.WriteLine ("Enter a valid value between 0 to 30");
}while(extmu < 0 || extmu >30);
//displaying the data
Console.WriteLine ("Revenue for the month of "+arr[month-1]);
Console.WriteLine("Number of interior murals : "+intmu);
Console.WriteLine("Number of exterior murals : "+extmu);
//calcultaing the total revenue
total=(100*intmu)+(200*extmu);
Console.WriteLine("Total Revenue : Rs "+total);
}
}
Please provide source code and display response.
In: Computer Science
Prove the following using the properties of regular expressions:
In: Computer Science
In: Computer Science
Let X = {x1,x2,...,xn} a sequence of real numbers. Design an algorithm that in linear time finds the continue subsequence of elements xi,xi+1,...,x, which product is the maximum. Suppose that the product of an empty subsequence is 1 and observe that the values can be less to 0 and less to 1.
In: Computer Science
Comment the code explaining what each line is doing. The first line has been done for you.
x=[0 0 -1 2 3 -2 0 1 0 0]; %input discrete-time signal
x dtx= -2:7;
y=[1 -1 2 4];
dty=8:11;
z=conv(x,y);
dtz=6:18;
subplot(1,3,1), stem(dtx,x)
subplot(1,3,2), stem(dty,y)
subplot(1,3,3), stem(dtz,z)
In: Computer Science
Use the cumsum command in MATLAB to show that the cumulative sum of an impulse is a unit step function. Add a line to your code from Problem 2. Plot the unit step function generated by the cumsum command. Turn in a copy of the code and graph.
In: Computer Science
In: Computer Science
In one paragraph, please briefly explain why cloud customer should use AWS KMS.
In: Computer Science
Use one sentence to briefly describe the difference between symmetric encryption and asymmetric encryption.
In: Computer Science
Resource Monitor. Windows 10
Uncheck perfmon.exe.
In: Computer Science
C++
// Program Description: This program accepts three 3-letter words and prints out the reverse of each word
A main(. . . ) function and the use of std::cin and std::cout to read in data and write out data
as described below.
Variables to hold the data read in using std::cin and a return statement.
#include <iostream >
int main(int argc, char *argv[]) {
.... your code goes here
}//main
Example usage:
>A01.exe Enter three 3-letter space separated words, then press enter to display the reverse: cat eye fix tac eye xif Enter any key to exit:
In: Computer Science