Answer:
- output = ""
- for i in range(7):
- if(i % 3 == 0):
- for i in range(5):
- output+= "*"
- output += "\n"
- else:
- for i in range(2):
- output += "* "
- output += "\n"
-
- print(output)
Explanation:
The solution code is written in Python 3.
Firstly, create a output variable that holds an empty string (Line 1).
Create an outer loop that will loop over 7 times to print seven rows of stars (Line 2). In row 0, 3 and 6 (which are divisible by 3) will accumulate up to 5 stars using an inner loop (Line 4-5) whereas the rest of the row will only print two stars with each start followed by a single space (Line 8-9) using another inner loop.
At last, print the output (Line 12).
Answer:
I believe that the only way to really make an informed decision as to which test is a better fit for you is to take a full-length diagnostic exam for both the ACT and the SAT before doing any prep. I also would look at the pros and cons for each test.
I personally took the ACT because there is <em>NO PENALTY </em>for guessing on the test. An educated guess won't hurt your score on the ACT.
Answer:
Option c is correct.
Example :
public class Subject
{
public static void main(String [] args)
{
int ar[]={5,4,6,7,8};
System.out.println("the number of array elements are: ",ar.length);
}
}
Explanation:
The above program is created in java language in which Subject is a class name.Inside Subject class , there is main method.
Inside the main method, there is An array named 'ar' which data type is an integer and we have assigned the value to this array.
in the next line, we are printing the total no. of the element in the array with the length function which displays the length of an array or variable.
Answer:
The program is as follows:
<em>5 INPUT A,B</em>
<em>6 PROD = A * B</em>
<em>7 PRINT PROD</em>
<em>8 TOTAL = A + B</em>
<em>9 PRINT TOTAL</em>
<em>10 DIFF = A - B</em>
<em>11 PRINT DIFF</em>
<em>12 END</em>
Explanation:
This gets input for the two numbers
<em>5 INPUT A,B</em>
This calculates the product
<em>6 PROD = A * B</em>
This prints the calculated product
<em>7 PRINT PROD</em>
This calculates the sum
<em>8 TOTAL = A + B</em>
This prints the calculated sum
<em>9 PRINT TOTAL</em>
This calculates the difference
<em>10 DIFF = A - B</em>
This prints the calculated difference
<em>11 PRINT DIFF</em>
This ends the program
<em>12 END</em>