Suppose the original matrix is
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
The output should be like as follows.
1
1 2
1 2 3
1 2 3 4
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
const int NUM = 5;
int main()
{
// I - Declaring a five by five array
/* II - Read data from data.txt and use them to create
the matrix in the previous step*/
/* III – print out the left bottom below the diagonal of the matrix and keep the triangle shape. Note the numbers on the diagonal are not included in the output.
read.close();
return 0;
In: Computer Science
The goal of this assignment is to give you some experience writing code with control structures in Java.
You will create a number guessing game program. The program will randomly choose a number between 0 and 100 that the user will try to guess. The user will be given a maximum number of tries (10 max) to guess the number. The user wins only when they guess the randomly chosen number before the maximum number of tries expires. Otherwise, the user loses the game. During the course of playing the game, you need to let the user know whether the guess was too high or too low.
The program should display instructions on how to play the game, number of wins, losses, and the total number of guesses.
I want you to use the Java API or other online resources to find
out how to generate a random number.
In: Computer Science
Ex. 1.Create a Python script . Write a program that goes through a tupple of numbers representing the temperatures taken at regular intervals in a day, at least 6 of them. The program should store this tupple in a variable, and then computing the average temperature. For that, use a for loop going over the temperature and adding all the values to a variable sum, initialized as 0. Then at the end, divide the sum by their count, and output a message communicating what the average temperature was on that day.
Ex. 2. Password verification Write a program that inputs a string from the user representing a password, and checks its validity. A valid password must contain: At least 1 lowercase letter (between 'a' and 'z') and 1 uppercase letter (between 'A' and 'Z'). At least 1 digit (between '0' and '9' and not between 0 and 9). At least 1 special character (hint: use an else to count all the characters that are not letters or digits). A minimum length 6 characters. No spaces (hint: when you encounter a space, you can break out of the loop). The program should output a message saying that the password is valid, or if it isn't valid, saying why not. For example, if the password has a length of 5, the output should say "The password is too short; a minimum of 6 characters required" and so on.
In: Computer Science
I need solution for following question.
Self-Test Exercise 18 asked you to overload the operator >> and the operator << for a class Percent. Complete and test this exercise. Implement the default constructor and the constructor with one int parameter. Overload the + and − operators to add and subtract percents. Also, overload the * operator to allow multiplication of a percent by an integer.
Write a program to test all the member functions and overloaded operators in your class definition.
In: Computer Science
Insertion sort for 12, 2, 3, 21, 11, 10,8 java lanuage
In: Computer Science
Binary search for K=12 in the array A={2, 3, 5, 7,11,15, 16,18,19}
output
In: Computer Science
In: Computer Science
Related to HTML/CSS. Please choose correct answer.
Descendent selectors can be used to select....
a. only nested element
b. only parent/child element
c. only nested type selector
d. any element state
In: Computer Science
a) What types of files might you want to copy to the cloud? Why
would you copy files to
the cloud instead of copying them to an external storage
device?
b) How does the access time of storage compare with the access
time of memory?
c) End user programs are designed for specific functions such as
word processing or a
game. You have installed a new piece of applications software onto
a stand-alone PC.
You then find that the printer attached to the PC fails to produce
what can be seen on
screen in that package. Explain clearly why this might happen.
In: Computer Science
Define .svg, .ps, .ai, and .eps. Describe how these file formats are used in web design?
In: Computer Science
A local online bitcoin wallet company, Luno is running out of capacity and performance with the current storage system. Luno has decided to own a RAID system at a reasonable cost to increase the speed, capacity, availability and scalability of the trading activities.
(a) Recommend a suitable RAID system for Luno. Provide your strong justifications.
In: Computer Science
A young child wants to jump over a puddle. The caregiver
agrees, but has conditions: “you can jump until you are tired but
you cannot jump over the puddle more than 15 times”.
Can someone write this to me in pseudo code and flow chat please
thanks
In: Computer Science
please use c
write a program that utilizes pipes for Interprocess Communication (IPC). The program will create a pipe(s) to allow the parent and child to communicate.
The parent process will generate a random number based on the pid of the child process created. The parent will send this random number to the child and wait for a response (Received) from the child. After receiving a response from the child, the parent will send another message to the child telling the child it is okay to end. This message should be “BYE”.
The child process should wait to receive the random number from the parent. After receiving the random number, it should send a response back to the parent. This message should be “Received”. The child should then wait for another message (BYE) from the parent indicating it is okay for the child to end.
Both processes should print to standard output the message it will write to the pipe and any message it receives from the pipe. Each message printed should be the process (“Parent” or “Child”) and if the message will be sent to the pipe or if it was received by the pipe. Example output might be similar to this:
Parent sending to pipe: 784392
Child received from pipe: 784392
Child sending to pipe: Received
Parent received from pipe: Received
Parent sending to pipe: BYE
Child received from pipe: BYE
Make sure you follow good programming practices, such as the use of functions, closing file descriptors as soon as not needed, in-line comments, error checking, freeing dynamic memory, etc.
use any programming language that allows the creation of new processes similar to the fork() system call in C and the use of pipes similar to the pipe() system call in C.
In: Computer Science
As part of the duties of a digital forensics examiner, creating an investigation plan is a standard pactice. Write a paper that describes how you would organize an investigation for a potential fraud case. In addition, list methods you plan to use to validate the data collected from drives and files, such as Word and Excel, with hashes. Specify the hash algorithm you plan to use, such as MD5 or SHA1.
In: Computer Science