Answer:
num1 = 600
Explanation:
Given
The attached code snippet
Required
The output of n = funcOne(funcTwo(n)); when n = 30
The inner function is first executed, i.e.
funcTwo(n)
When n = 30, we have:
funcTwo(30)
This returns the product of n and 10 i.e. 30 * 10 = 300
So:
funcTwo(30) = 300
n = funcOne(funcTwo(n)); becomes: n = funcOne(300);
This passes 300 to funcOne; So, we have:
n = funcOne(300);
This returns the product of n and 2 i.e. 300 * 2 = 600
Hence, the output is 600
Answer:
The advantage and the disadvantage of the relevant query are illustrated in the explanation in the paragraph below.
Explanation:
Advantage:
Disadvantage:
Answer:
Switch rows to column and vice versa
Explanation:
Transpose "pasting option" is used to switch positions of cells from rows to column or from columns to rows depending on the current position of the cells being highlighted.
This can be done in two ways
1. Follow the steps as it is in the question above
2. Use the excel transpose inbuilt function.
Either of these two ways will give the desired result.
But is should be noted that, the transposing cells will not copy the formats (bold, italics, underline, etc.) of the selected range of cells; buy rather only the cell values will be copied.
Lastly, when making use of transpose, cells at the first rows will maintain the first column, those at the second row will maintain the second column, those at the third row will maintain the third column till it gets to the last row and column.
HIERARCHICAL EXAMPLE.
Many examples of hierarchical addressing exists which reduces the amount of work needed in locating or in delivering,and one of such examples is the 'sorting of books in a library'.
Looking at a library having books kept randomly on any stack and shelf,it will make it difficult finding any book easily or locating any book of a specific genre.so,to avoid such problems, books are orderly sorted in a library and each book is given or has a unique identification number.
Books that has the same or related subject are kept in the same stack and books of the same genre are also kept together.
In a library,there are many stacks having different rows.
Take for an example; If one need to find a book on computer network,the user can search for the books in stacks of books that are related to Computer Science instead of searching the whole library for the book.
So,the hierarchical addressing saves lots of work and also time required for searching a specific book in the library.
instructions:
You need to write code that will print two bricks of numbers, one with integers, one with decimals.
import random
i = 1
while i <= 100:
print("#"+str(i)+": "+str(random.randint(1,100)), end=", ")
i+=1
print()
i = 1
while i <= 100:
print("#"+str(i)+": "+str(random.uniform(1,100)), end=", ")
i += 1
I hope this helps!
Adobe Photoshop
b
Internet Explorer
c
Windows
d
Microsoft Word
Answer:
windows
Explanation:
Examples of Operating Systems
Some examples include versions of Microsoft Windows (like Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP), Apple's macOS (formerly OS X), Chrome OS, BlackBerry Tablet OS, and flavors of Linux, an open-source operating system.
(2) Modify the given program to use a loop to output an arrow base of width arrowBaseWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow base. (1 pt)
(3) Modify the given program to use a loop to output an arrow head of width arrowHeadWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow head. (2 pts)
(4) Modify the given program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue prompting the user for an arrow head width until the value is larger than the arrow base width. (1 pt)
while (arrowHeadWidth <= arrowBaseWidth) {
// Prompt user for a valid arrow head value
}
Example output for arrowBaseHeight = 5, arrowBaseWidth = 2, and arrowHeadWidth = 4:
Enter arrow base height:
5
Enter arrow base width:
2
Enter arrow head width:
4
**
**
**
**
**
****
***
**
*
This is what I have:
import java.util.Scanner;
public class DrawHalfArrow
{
public static void main(String[] args)
{
Scanner scnr = new Scanner(System.in);
int arrowBaseHeight = 0;
int arrowBaseWidth = 0;
int arrowHeadWidth = 0;
System.out.println("Enter arrow base height:");
arrowBaseHeight = scnr.nextInt();
System.out.println("Enter arrow base width:");
arrowBaseWidth = scnr.nextInt();
while (arrowHeadWidth >= arrowBaseWidth)
{
System.out.println("Enter arrow head width:");
arrowHeadWidth = scnr.nextInt();
}
// Draw arrow base (height = 3, width = 2)
for(int i=0; i < arrowBaseHeight; ++i)
{
for(int j=0; j < arrowBaseWidth; ++j)
{
System.out.print("*");
}
System.out.println();
}
// Draw arrow head (width = 4)
for(int i=0; i < arrowHeadWidth; ++i)
{
for(int j=0; j < arrowHeadWidth-i; ++j)
{
System.out.print("*");
}
System.out.println();
}
return;
}
}
Answer:
The modified program in Java is as follows:
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int arrowHeadWidth, arrowBaseWidth, arrowBaseHeight;
System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();
System.out.print("Base Width: "); arrowBaseWidth = input.nextInt();
System.out.print("Base Height: "); arrowBaseHeight = input.nextInt();
while (arrowHeadWidth <= arrowBaseWidth) {
System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();
System.out.print("Base Width: "); arrowBaseWidth = input.nextInt(); }
for(int i = 0; i<arrowBaseHeight; i++){
for(int j = 0; j<arrowBaseWidth;j++){
System.out.print("*"); }
System.out.println(); }
for(int i = arrowHeadWidth; i>0;i--){
for(int j = 0; j<i;j++){
System.out.print("*"); }
System.out.println(); }
}
}
Explanation:
This declares the arrow dimensions
int arrowHeadWidth, arrowBaseWidth, arrowBaseHeight;
This get input for the head width
System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();
This get input for the base width
System.out.print("Base Width: "); arrowBaseWidth = input.nextInt();
This get input for the base height
System.out.print("Base Height: "); arrowBaseHeight = input.nextInt();
This loop is repeated until the head width is greater than the base width
while (arrowHeadWidth <= arrowBaseWidth) {
System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();
System.out.print("Base Width: "); arrowBaseWidth = input.nextInt(); }
This iterates through the base height
for(int i = 0; i<arrowBaseHeight; i++){
This iterates through the base width
for(int j = 0; j<arrowBaseWidth;j++){
This fills the base
System.out.print("*"); }
This prints a new line
System.out.println(); }
These iterate through the arrow head
for(int i = arrowHeadWidth; i>0;i--){
for(int j = 0; j<i;j++){
This fills the arrow head
System.out.print("*"); }
This prints a new line
System.out.println(); }