using a class n times with a for loop c++

I’m trying to learn classes, so here I want to create n-number Triangle and Rectangle types, input a,b,c, also input from user and then cout them.. im trying to get n-number of Triangle and Rectangle with for loop but at the end I get print only the biggest S() and P() which user had entered..… Read More using a class n times with a for loop c++

How to print an index 0 of a list, with for loop?

Why does this code, does not return (or print) the 0 index of the list? N = int(input()) letters = [‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ‘O’, ‘P’, ‘Q’, ‘R’, ‘S’, ‘T’, ‘U’, ‘V’, ‘W’, ‘X’, ‘Y’, ‘Z’] for i in range(N): print(letters[i]*i) output: should be: A… Read More How to print an index 0 of a list, with for loop?

How do obtain max and mean values from different columns with a Date column condition in R?

I am trying to get the daily mean and maximum values for each pollutant. For each of the monitoring stations, the daily mean and maximum values of each pollutant shall be calculated. Here is a sample of my dataframe: df <- data.frame (Station = c(1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4,… Read More How do obtain max and mean values from different columns with a Date column condition in R?

How to split an array of strings whose indexes contain integers and letters Java

Hi guys! =) I’m new to Java, currently, I’m learning arrays and loops. I have an interesting homework task that I am very confused about. And I don’t know what to do with this one. So I need your advice. Create a public String getCheapStocks(String[] stocks) method in it. It takes an array of strings… Read More How to split an array of strings whose indexes contain integers and letters Java