5.24 LAB: Two smallest numbers Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. You can assume that the list will have at least 2 integers and less than 20 integers. Ex: If the input is: 5 10 5 3 21 2 the output is: 2 3 To achieve the above, first read the integers into an array. Hint: Make sure to initialize the second smallest and smallest integers properly. 265236.1527390

Answers

Answer 1

Answer:

Here is the C++ program:

#include <iostream>   //to use input output function

#include <vector>   //to use vectors

using namespace std;   //to identify objects like cin cout

int main() {   //start of main method

int size, number;   //to store size of list and input numbers

cout<<"Enter list size: ";   //prompts user to enter size of the list

cin >> size;   //reads list size from user

vector<int> v;   //creates a vector named v

for (int i = 0; i < size; ++i) {  //iterates till the size of list reaches

cin >> number;   //reads the input numbers

v.push_back(number);   }  //push number into a vector from the back

int num1 = v[0], num2 = v[1], current , temp;    //num1 is set to the element at 0-th position of v and num2 is set to be on 1st index of v

if (num1 > num2)  {  //if num1 is is greater than num2

temp = num1;   //assigns value of num1 to temp

num1 = num2;  //assigns value of num2 to num1

num2 = temp;  }  //assigns value of temp to num2

for (int i = 2; i < size; ++i)  {  //iterates size times

current = v[i];  //set current to the i-th index of v

if (current < num1)  {  //if current is less than num1

num2 = num1;   //assigns value of num1 to num2  

num1 = current;  }  //assigns value of current to num1

else if(current < num2)   {  //if value of current is less than num2

num2 = current;  } }  //assigns value of current to num2

cout<<num1<< " "<<num2<< endl;  } //dispalys num1 and num2 i.e. two smallest integers in ascending order

Explanation:

I will explain the program with an example.

Lets say the list size is 4 and numbers are 1 2 3 4

for (int i = 0; i < size; ++i)

This loop reads each number (1,2,3,4) and adds that number to the vector v which is the sequence container. The method push_back is used which inserts each number into the vector at the end, after the current last number and the vector size is increased by 1.

Next num1 = v[0] becomes num1 = 1

and num2 = v[1] becomes num1 = 2

if (num1 > num2) this condition is false so program moves to the statement:

for (int i = 2; i < size; ++i)

current = v[i]; becomes current = v[2]; which is current = 3

if (current < num1) is false so program moves to :

else if(current < num2) this is also false.

So the program moves to the statement:

cout<<num1<< " "<<num2<< endl;

which prints these two numbers 1 and 2 on output screen as the two smallest integers in the list in ascending order. Hence the output of the program is:

1  2

The screenshot of output of the program is attached.

5.24 LAB: Two Smallest Numbers Write A Program That Reads A List Of Integers, And Outputs The Two Smallest
Answer 2

Answer:

integers=[]

while True:

      number=int(input())

      if number<0:

       break

      integers.append(number)  

print("",min(integers))

print("",max(integers))

Explanation:


Related Questions

2. What types of news can be created?

Answers

Answer:

Print Media

Broadcast Media

Explanation:

It can be made manually/artificially (meaning that someone caused something to happen on purpose) or naturally (meaning it just happened with out outside assistance)

Hope this helps you

What is the output of the following program?
S = "foo"
t = "bar"
print(((s+t)*3).count("barf"))

Answers

´´´´´´´´´´´´´´´´´´´´´´¶¶¶¶¶¶¶¶¶´´´´´´´´´´´´´´´´´´´´¶¶´´´´´´´´´´¶¶´´´´´´¶¶¶¶¶´´´´´´´¶¶´´´´´´´´´´´´´´¶¶´´´´´¶´´´´´¶´´´´¶¶´´´´´¶¶´´´´¶¶´´´´´¶¶´´´´´¶´´´´´¶´´´¶¶´´´´´´¶¶´´´´¶¶´´´´´´´¶¶´´´´´¶´´´´¶´´¶¶´´´´´´´´¶¶´´´´¶¶´´´´´´´´¶¶´´´´´´¶´´´¶´´´¶´´´´´´´´´´´´´´´´´´´´´´´´´¶¶´´´´¶¶¶¶¶¶¶¶¶¶¶¶´´´´´´´´´´´´´´´´´´´´´´´´¶¶´´´¶´´´´´´´´´´´´¶´¶¶´´´´´´´´´´´´´¶¶´´´´´¶¶´´¶¶´´´´´´´´´´´´¶´´¶¶´´´´´´´´´´´´¶¶´´´´´¶¶´¶¶´´´¶¶¶¶¶¶¶¶¶¶¶´´´´¶¶´´´´´´´´¶¶´´´´´´´¶¶´¶´´´´´´´´´´´´´´´¶´´´´´¶¶¶¶¶¶¶´´´´´´´´´¶¶´¶¶´´´´´´´´´´´´´´¶´´´´´´´´´´´´´´´´´´´´¶¶´´¶´´´¶¶¶¶¶¶¶¶¶¶¶¶´´´´´´´´´´´´´´´´´´´¶¶´´¶¶´´´´´´´´´´´¶´´¶¶´´´´´´´´´´´´´´´´¶¶´´´¶¶¶¶¶¶¶¶¶¶¶¶´´´´´¶¶´´´´´´´´´´´´¶¶´´´´´´´´´´´´´´´´´´´´´´´¶¶¶¶¶¶¶¶¶¶¶

The output of the following program is 2.

What is output of this program?

S = "foo"

t = "bar"

print(((s+t)*3).count("barf"))

here we get The output is 2

Information that is processed and sent out by a program or another electronic device is considered its output. The output is anything that is audible on the display screen, such as the words you type on the keyboard.The term "output" refers to any data that a computer or other electronic device processes and sends. Anything that can be seen on a computer screen, such as the text you write on a keyboard, is an example of output.

To learn more about output refer to:

https://brainly.com/question/27646651

#SPJ2

Harry is creating a PowerPoint presentation and wants all the slides to have a uniform look.

The first thing Harry should do is select the
.

Next, he should use the command groups to edit the
.

Finally, he should save the file as a new
.

Answers

Answer: all answers for test are

Slide Master View

Layout and Theme

PowerPoint Template

A.

C.

Slide Master Thumbnail, Insert Tab, Header &Footer, Slide tab in the dialog box.

D.

C.

D.

Explanation:

The first thing Harry should do is select the Slide Master View, Next, he should use the command groups to edit the Layout and Theme. Finally, he should save the file as a new PowerPoint Template.

What is PowerPoint?

It is a presentation-based programme that employs graphics, movies, etc. to enhance the interactivity and appeal of a presentation.

A saved Powerpoint presentation has the ".ppt" file extension. PPT is another name for a PowerPoint presentation that includes slides and other elements.

This right-sided brain activity is perfectly suited to the principal function of PowerPoint presentations.

For his PowerPoint presentation, Harry wants each slide to have a consistent appearance.

Harry must first choose the Slide Master View before using the command groups to change the Layout and Theme. The file should then be saved as a fresh PowerPoint Template.

Thus, this way, Harry can create a uniform look.

For more details regarding PowerPoint, visit:

https://brainly.com/question/14498361

#SPJ2

6.12 Nested Increments Write a program for spiritual lumberjacks who want to show their appreciation for each tree they 'kill' by celebrating its years of life. Ask the lumberjack how many trees he wants to cut. Verify you got the number correctly by printing it to output. Write a loop that iterates over all the trees the lumberjack wants to cut down. Print the tree number to the screen to make sure your loop is working correctly. Query the lumber jack for how many rings are in this tree and print this number to make sure you got the correct number of rings. Write an inner loop that iterates over the years of the tree. Print each year to make sure you are iterating correctly and hitting each year that it lived. Change the necessary print statements and to match the correct formatting from the output examples.

Answers

Answer:

trees_to_cut = int(input("How many trees do you wants to cut? "))

print(str(trees_to_cut) + " tree(s) will be cut.")

for i in range(trees_to_cut):

   print("Tree #" + str(i))

   

   rings = int(input("How many rings in tree " + str(i) + "? "))

   print("There are " + str(rings) + " ring(s) in this tree.")

   for j in range(rings):

       print("Celebrating tree #" + str(i) + "'s " + str(j+1) + ". birthday.")

Explanation:

*The code is in Python.

Ask the user to enter the number of trees to cut

Print this number

Create a for loop that iterates for each tree

Inside the loop:

Print the tree number. Ask the user to enter the number of rings. Print the number of rings. Create another for loop that iterates for each ring. Inside the inner loop, print the celebrating message for each birthday of the tree

______________ helps you see how your document will appear on the paper. ​

Answers

Answer:

Print Preview

Explanation:

The "Print Preview" gives a person the idea on how his/her document will look like once it is printed out. Having an overview of the document will let you know whether you need to do some adjustments or edit some things before you actually print it.

There's a shortcut for this when it comes to the "Microsoft Word." All you have to do is to press ctrl + F2. Nevertheless, more modern computers don't need the print preview anymore since you can see the whole document on the actual print page.

In Java code, the line that begins with/* and ends with*/ is known as?​​​​​​​​​​​​​​​​​​​

Answers

Answer:

It is known as comment.

Two Smallest (20 points). Write a program TwoSmallest.java that takes a set of double command-line arguments and prints the smallest and second-smallest number, in that order. It is possible for the smallest and second-smallest numbers to be the same (if the sequence contains duplicate numbers). Note: display one number per line. Hint: Double.MAX_VALUE is the largest real number that can be stored in a double variable. java TwoSmallest 17.0 23.0 5.0 1.1 6.9 0.3 0.3 1.1 java TwoSmallest 1.0 35.0 2.0 1.1 6.9 0.3 0.3 6.7 0.3 0.3

Answers

Answer:

Written in Java

import java.util.*;

public class Main {

   public static void main(String args[]) {

     int n;

     Scanner input = new Scanner(System.in);

     n = input.nextInt();

     double nums []= new double [n];

     for (int i=0; i<n;i++)

     {

         nums[i] = input.nextDouble();

     }

     

     Arrays.sort(nums);

     System.out.println("The two smallest are: ");

     for (int i=0; i<2;i++)

     {

         System.out.println(nums[i]);

     }

   }

}

Explanation:

This line declares number of input

     int n;

This line calls the Scanner function

     Scanner input = new Scanner(System.in);

This line gets input from user

     n = input.nextInt();

This line declares an array of n elements

     double nums []= new double [n];

The following iteration gets input into the array

     for (int i=0; i<n;i++)

     {

         nums[i] = input.nextDouble();

     }

This line sorts the array

     Arrays.sort(nums);

The following iteration prints the two smallest

     System.out.println("The two smallest are: ");

     for (int i=0; i<2;i++)

     {

         System.out.println(nums[i]);

     }

What is the appropriate guidelines to create and manage files

Answers

Answer:

1. Do not copyright

2. Nothing illegal

3.Do not put personal info

Explanation:

Donna wants to save personal files on her computer. Which characteristic of the computer is must useful for her​

Answers

Answer:

D. Storage

Explanation:

When Donna wants to save personal files on her computer, the storage characteristic of the computer would be most useful to her. This feature of the computer allows files to be stored in several forms. The computer has the primary and secondary storage.

The primary storage includes assets such as the Random Access Memory while the secondary storage includes assets like the SD card, DVD, etc. Storage is important as it makes files easily retrievable when needed.

The storage characteristic of the computer is most useful to her in this scenario.

The Storage components in a computer helps to stores and facilitate easy retrieval of various type of data on the system.

The primary storage includes component of the Random Access Memory while the secondary storage includes SD card, Flash drives, External CD-rome, etc.

Therefore, she can save her personal files on her internal or external storage so as to facilitate easy retrieval at the time of future use.

Learn more about this here

brainly.com/question/272186

Sue conducted an experiment to determine which paper towel is the most absorbent among three different brands. She decides to present her data using a chart.

Why would Sue want to present her data using a chart?

to analyze alphanumeric data in a table
to analyze alphanumeric values in a spreadsheet
to present numeric values in a visually meaningful format
to present numeric values in a meaningful spreadsheet format

Answers

Answer:

c

Explanation:

What happens when you forward an Outlook contact item to a non-Outlook user?

Answers

Answer:

It's A. The recipient will not be able to open the contact item.

Explanation:

Correct on edg

Answer:

A on edg

Explanation:

There are a multitude of items that Cyber Security professionals view as attack vectors but none are more prevalent and exploitable than application code or as readily available as the network perimeter. There are many ways that these areas are exploited. The application side has its beginning with code which is poorly designed from a security perspective. One of the code items that is exploited by fraudsters to pivot across an organization's internal network is the Web.cfg file - in this file non security minded programmers often leave the User ID and password for connecting to the associated database in plaintext.
For part one of this assignment, write a 1 page summary that explains to a non IT person what this attack is, how it works and how to prevent it.
The second part of this assignment is about the secure perimeter. Using your choice of reference for securing a network (NIST, Rainbow Series Red Book, Common Criteria etc.) research on how to design a secure network perimeter that will protect the internal applications, even poorly written ones like the one above from being exploited. Include a diagram of your solution and on the bottom half - a written explanation, in APA format, of your solution.

Answers

AnsweR

RRR

Explanation:

Kim wants to add a new tab on the ribbon named “Paste as Pictures” for a group of special commands. Put the steps in the correct order to explain how she can accomplish this task.

Step 1: Go to the Backstage view.

Step 2: Select Customize Ribbon.

Step 3: After a dialog box opens, navigate to the right side.

Step 4:

Step 5:

Step 6: Then, click OK.

Answers

✔ Click Options.

✔ Click New tab.

✔ Click Rename.

✔ Type a name.

Write your code to define and use two functions. The Get User Values function reads in num Values integers from the input and assigns to user Values. The Output Ints Less Than Or Equal To Threshold function outputs all integers in user Values that are less than or equal to maxVal. num Values indicates the number of integers in user Values. void Get User Values(int user Values[], int num Values) void Output Ints Less Than Or Equal To Threshold (int user Values[], int maxVal, int num Values)

Answers

Answer:

#include <iostream>

#include <vector>

using namespace std;

/* Define your function here */

vector<int> GetUserValues(vector<int>& userValues, int numValues) {

  int tmp = 0;

  vector<int> newVec;

 

  for(int i = 0; i < numValues; i++) {

     cin >> tmp;

     newVec.push_back(tmp);

     

  }

 

  return newVec;

}

void OutputIntsLessThanOrEqualToThreshold(vector<int> userValues, int upperThreshold) {

  for (int i = 0; i < userValues.size(); ++i) {

     if(userValues.at(i) < upperThreshold) {

          cout << userValues.at(i) << " ";

     }

  }

 

  cout << endl;

}

int main() {

  vector<int> userValues;

  int upperThreshold;

  int numValues;

 

  cin >> numValues;

  userValues = GetUserValues(userValues, numValues);

  cin >> upperThreshold;

  OutputIntsLessThanOrEqualToThreshold(userValues, upperThreshold);

  return 0;

}

Explanation:

Perhaps their is a better way to code this, but I couldn't figure out what to do with the pointer in the first function.

Bluetooth's pan are also known as______.​

Answers

Answer:

personal area network..??

Explanation:

Which option provides an easy ability to label documents that can then be used as the basis for a document search?
author
title
tags
modified

Answers

The option which provides an easy ability to label documents that can then be used as the basis for a document search is referred to as: B. title.

A document can be defined as a computer resource that enable end users to easily store data as a single unit on a computer storage device.

Generally, all computer documents can be identified by a title, size, date modified, and type such as;

SystemTextAudioImageVideo

A title is a feature that avail end users the ability to easily label a document, as well as serve as the basis for a document search on a computer. For example, "My list" is a title and it can be used to search for a document on a computer.

Read more on document here: https://brainly.com/question/24849072

Answer:

B: Title

Explanation: Edge 2023

In this lab you are asked to declare two variables of type integer: userNum and x. The user should input should be stored using scanf statements. Then you are asked to divide the value for userNum by x three times(three different operations). Each time you do the division, assign the value to userNum overwriting the previous value and print it out using a print statement. Do this three times. In this case there is only one new line print statement at the end.
#include
int main(void) {
int x;
int userNum;
scanf("%d %d" , &userNum, &x);
userNum = (double)userNum / x;
printf("%d " , userNum);
userNum = (double)userNum / x;
printf("%d " , userNum);
userNum = (double)userNum / (double)x;
printf("%lf\n" , (double)userNum);
return 0;
}
my input is 100 2
my output is 50 25 12.000
8 months ago

Answers

Answer:

See Explanation

Explanation:

Your program is correct and it follows the correct sequence; however, the reason you keep getting integer result is because the question requires that you declare both variables as integer.

The only modification required in your program is to change change #include to #include <stdio.h> for the program to be free of error.

Please help I upped the points and please don't answer if you don't have the answer..

3. Describe two of your long-term financial goals, and explain why these goals are important to you. List three steps that might help you accomplish this goal. (4-6 sentences. 2.0 points)

4. Describe and example of common financial resource, and example, and a debt. These can be examples from your own life or from other people you know or can imagine. (3-6 sentences. 3.0 points)

Answers

Answer:

3. Paying for my daughter to attend college and building a life outside of struggle. These goals must be accomplished by me finishing school, going onto college and maybe even starting my own business. I must set an appropriate example for my daughter to learn from someone who she believes in. Starting a family business to pass down to generations will be an excellent way to start financially planning now ahead of time.

4. Living in a family of mines, common financial resource is either government assisted or public security.An expense that I cannot escape now is the caring for of my daughter which will vary as she get older. Lastly a debt would be the over spending of credit cards with no money to pay it back as the interest rates climb.

Explanation:

Which of the following takes place during the research phase

Answers

i would say a formulation of the hypothesis

I am unsure if this is the correct question, but I think this is the full question:

Which of the following takes place during the research phase? (choose all that apply)

O software requirements are gathered

O software requirements are implemented in code

O software requirements are analyzed

O software requirements are detailed in a specification document

The answers to this question are software requirements are gathered, software requirements are analyzed, and software requirements are detailed in a specification document (1st, 3rd, and 4th options).

Which tasks can Kim complete using the Customize Ribbon dialog box? Check all that apply.

Rename existing ribbon tabs.
Rearrange ribbon commands.
Add a new main tab to the ribbon.
Add commands to existing groups.
Create new PowerPoint commands.
Add a new contextual tab to the ribbon.

Answers

Answer:

Its A, B, C, and F

Explanation:

On edg

Rename existing ribbon tabs, Rearrange ribbon commands, Add commands to existing groups and Add a new contextual tab to the ribbon.

What is PowerPoint presentation?

A PowerPoint presentation is a type of visual aid that creates a slideshow of information that can be presented to an audience using Microsoft PowerPoint software.

It is typically made up of a series of slides that include text, images, charts, graphs, and other multimedia elements to convey information to the audience.

Kim can complete the following tasks by using the Customize Ribbon dialog box:

Existing ribbon tabs can be renamed.Rearrange the commands on the ribbon.To existing groups, add commands.To the ribbon, add a new contextual tab.

Thus, Kim cannot use the Customize Ribbon dialog box to add new PowerPoint commands or a new main tab to the ribbon.

For more details regarding presentation ,visit:

https://brainly.com/question/14498361

#SPJ7

Describe the two best practices for making html code more readable.

Answers

Answer:

1 - Commenting and Documentation.

2 - Consistent Indentation.

3 - Avoid Obvious Comments.

4 - Code Grouping.

5 - Consistent Naming Scheme.

6 - DRY Principle.

7 - Avoid Deep Nesting.

8 - Limit Line Length.

Explanation:

Hope this helped

Gloria is adding footers to a PowerPoint template for students to use in a literature class. Each student must choose an author and make a presentation about their life and work. She wants the first slide in each presentation to show only the author’s name and photo. On subsequent slides, she wants to include a footer with a date and time that changes depending on the actual date of each presentation.

After selecting the Slide Master view, how should Gloria proceed?

She should select
.

Next, she should select
.

Then, she should select
.

Finally, she should make changes in the
.

Answers

Answer:

✔ the Slide Master thumbnail

✔ the Insert tab

✔ Header & Footer

✔ Slide tab in the dialog box

Explanation:

On edg

The Slide Master thumbnail, the Insert tab and Header & Footer and  Slide tab in the dialog box.

What is Dialog box?

A dialog box, often known as a dialog or a conversation box, is a typical form of window in an operating system's graphical user interface (GUI).

In addition to displaying more details, the dialog box also prompts the user for input.

For instance, you interact with the "File Open" dialog box when you want to open a file while using a software. The Properties dialog box appears in Microsoft Windows when you right-click a file and select Properties.

A dialog box, often known as a dialog or a conversation box, is a typical form of window in an operating system's graphical user interface (GUI). In addition to displaying more details, the dialog box also prompts the user for input.

Therefore, The Slide Master thumbnail, the Insert tab and Header & Footer and  Slide tab in the dialog box.

To learn more about Software, refer to the link:

https://brainly.com/question/985406

#SPJ3

What is Naptha used for?

Answers

Answer:

Naphtha is used to dilute heavy crude oil to reduce its viscosity and enable/facilitate transport; undiluted heavy crude cannot normally be transported by pipeline, and may also be difficult to pump onto oil tankers. Other common dilutants include natural-gas condensate, and light crude.

Answer:

Naphtha is used for laundry soaps and clearing fluids

High Hopes^^

Barry-

What is a backdoor?
A. A different sign-in page to log into a computer
B. An unrecognized entry into a computer or system
C. A fake version of software to access a computer system
D. An administrative login feature of computer software

Answers

B. Generally backdoors are logins/access to something without permission and without admins knowing.

Write the definition of a function named count that reads all the strings remaining to be read in standard input and returns their count (that is, how many there are) So if the input was:
hooligan sausage economy
ruin palatial
the function would return 5 because there are 5 strings there.

Answers

Answer:

The function written in C++

int str(string word) {

int count = 1;

for(int i =0; i<word.length();i++) {

 if(word[i] == ' ') {

  count++;

 }

}

return count;

}

Explanation:

This line defines the function

int str(string word) {

This line initializes count to 1

int count = 1;

This line iterates through the input string

for(int i =0; i<word.length();i++) {

This line checks for blank space

 if(word[i] == ' ') {

Variable count is incremented to indicate a word count

  count++;

 }

}

return count;

}

See attachment for full program

Write a function index(elem, seq) that takes as inputs an element elem and a sequence seq and returns the index of the first occurrence of elem in seq. The sequence seq can be either a list or a string. If seq is a string, elem will be a single-character string; if seq is a list, elem can be any value. If elem is not an element of seq, the function should return the length of the sequence. Dont forget that the index of the first element in a sequence is 0. Here are some examples: >>> index(5, [4, 10, 5, 3, 7, 5]) solution

Answers

Answer:

def index(elem, seq):

   for i in range(len(seq)):

       if elem == seq[i]:

           return i

   

   return len(seq)

print(index(5, [4, 10, 8, 5, 3, 5]))

Explanation:

Create a function named index that takes elem and seq as parameters

Create a for loop that iterates through the seq. If elem is equal to the item in the seq, return the i, index of the item.

If the elem is not found in the seq, this means nothing will be returned in the loop, just return the length of the seq, len(seq)

Call the function with given parameters and print the result

Note: Since 5 is in the list in the example, the index of the 5 which is 3 will be returned

In this exercise we have to use the knowledge of computational language in Python, so we have that code is:

It can be found in the attached image.

What is an index in Python?

An index, in your example, refers to a position within an ordered list. Python strings can be thought of as lists of characters; each character is given an index from zero  to the length minus one.

So, to make it easier, the code in Python can be found below:

def index(elem, seq):

  for i in range(len(seq)):

      if elem == seq[i]:

          return i

  return len(seq)

print(index(5, [4, 10, 8, 5, 3, 5]))

See more about python at brainly.com/question/26104476

Let T be the statement: The sum of any two rational numbers is rational. Then T is true, but the following "proof is incorrect. Find the mistake. "Proof by contradiction: Suppose not. That is, suppose that the sum of any two rational numbers is not rational. This means that no matter what two rational numbers are chosen their sum is not rational. Now both 1 and 3 are 1/1 and 3 3/1, and so both are ratios of integers with rational because 1 a nonzero denominator. Hence, by a supposition, the sum of 1 and 3, which is 4, is not rational. But 4 is rational because 4 4/1 , which is a ratio of integers with a nonzero denominator. Hence 4 is both rational and not rational, which is a contradiction. This contradiction shows that the supposition is false and hence statement T is true.

Answers

Answer:

the mistake is in the first statement.

Explanation:

Now lets us put the statement into consideration:

"The sum of any two rational numbers is irrational"

The negation is: " there exists a pair of rational numbers whose sum is irrational". (Existence of at least one of such a pair).

The negation is not "the sum of any two rational numbers is irrational"

Therefore the mistake is in the first statement and it is due to incorrect negation of the proof.

Dawn needs to insert a macro into a Word document. Where can she find the Insert Macro dialog box?
Insert tab
Developer tab
Advanced tab
Design tab

Answers

Answer:

Developer tab

Explanation:

Inserting the Macro dialog box can be confusing for many people because the "Developer tab," where it can be found, is hidden by default in Microsoft Word. In order to add this to the ribbon, all you have to do is to go to the File tab, then click Options. After this, click Customize Ribbon. Under this, choose Main Tabs, then select the Developer check box. The Developer tab will then become visible. You may now insert a macro.

Answer:

B- Developer tab

Write a Java program that generates a random number between 0 and 50. Then, the program prompts for guesses until the user is correct, or has made 10 wrong guesses. After each guess, the program indicates whether the guess was too high, too low, or correct. Once the round has ended, either by a correct guess or by using up the 10 guesses, the program displays the current status. Enter an integer number ( 0 to exit): 3241 3241 has 4 digits. Sum of digits of 3241 is 10. Enter an integer number ( 0 to exit): 264 264 has 3 digits. Sum of digits of 264 is 12. Enter an integer number ( 0 to exit): -12 -12 has 2 digits. Sum of digits of -12 is -3. Enter an integer number ( 0 to exit): 0 End. Enter a positive integer between 0 and 9: -3 Invalid input number. Enter a positive integer between 0 and 9: 15 Invalid input number. Enter a positive integer between 0 and 9: 5 0 !

Answers

Answer:

Here is the JAVA program:

import java.util.Scanner;  //to accept input from user

public class Main {   //class name

   public static void   GuessTheNumber()      {  //method to guess the number

       Scanner input = new Scanner(System.in);   //creates Scanner object to accept input from user

       int number = (int)(50 * Math.random()) ;   //generates random number from 0 to 50

       int trials = 10;  //allows 10 trials to user to guess the number

       int i, userGuess;  //stores user guess

       System.out.println("Guess a number between 0 to 50");  //prompts user to guess a number between 0 to 50  

       for (i = 0; i <trials; i++) {  //allows user to keep guessing in 10 trials

           System.out.println("Enter your guess: ");   //prompts user to enter a number as a guess

           userGuess = input.nextInt();  //reads users entered number(guess)

           if (number == userGuess) {  //if users guess is correct

               System.out.println("Congratulations! The guess is correct!");  //displays congratulatory message

               break;              }  //the loop breaks after correct guess is made

           else if (number>userGuess) {  //if user guess is less than correct number

               System.out.println("Too low");             }  

           else if (number<userGuess) {  //if user guess is greater than correct number

               System.out.println("Too high");            }          }    

       if (i == trials) {  //if user has made 10 wrong guesses

           System.out.println("You exceeded 10 trials!");

           System.out.println("The correct number was " + number);          }      } //displays the correct number if user made 10 wrong guesses

 

   public static void main(String arg[])      {     //start of main method

       GuessTheNumber();      }  } //calls method to start the guessing game

Explanation:

The program prompts the user to enter a guess and it uses random() method to generate randoms numbers from 0 to 50. The loop keeps iterating and prompting the user to enter a guess until the limit of number of trials exceeds. The trials are set to 10 so the user can guess a number in 10 tries. If the user guesses a number that is higher than the correct guess then the program indicates that the guess is too high by displaying a message "too high" and if user guesses a number that is lower than the correct guess then the program indicates that the guess is too low by displaying a message "too low". If user makes 10 wrong guess then the program displays the correct guess and ends. The screenshot of the output is attached.

How many parameters (values inside of the
parenthesis) does a message dialog box take?
A. 1
B. 2.
C. O
D. 3

Answers

Answer:

The answer to this question is given below.

Explanation:

The message dialog box contains many parameters, but primarily three parameters are used such message, title, and button.

So the correct answer to this question is 3.

The message dialog box contains three parameters such as message, title, and buttons.

Other Questions
Please help! Explain step by step pls :) (The question is on the image that i attached) What quest was the knight sent on by Queen Guinevere? Convert 66 ft/sec to miles per hour. (1 mi = 5280 ft) 348,480 mi/hr45 mi/hr80 mi/hr288,000 mi/hr0.75 mi/hr96.8 mi/hr IK and LN are parallel lines. Which angles are vertical angles? How does the author of the broadside view slavery? what were the natural rights Yi Min is a pitcher on her softball team. This season,she has allowed an average of 0.8 hits per inningpitched. If Yi Min pitched 60 innings this season,how many hits did she allow?A75B0.0130.02148 What types of jod did slaves do in the new England colonies HELP PLS I HABE BEEN STARING AT THUS QUESTION FOR SO LONG Julio eats a taco for dinner. What represents a physical change in the taco?A) saliva changing the starch in the crust to sugarB) teeth tearing off a bite of a taco C) chemicals in the stomach digesting proteins D) breaking down of fats in the taco by bile Find AC,AB=9x+1 BC=6x+25 Horizontal and parallel lines c and d are cut by transversal p. At the intersection of lines c and p, the uppercase left angle is angle 1 and the uppercase right angle is angle 2. At the intersection of lines d and p, the uppercase right angle is angle 3 and the bottom left angle is angle 4.Which set of equations is enough information to prove that lines c and d are parallel lines cut by transversal p?m1 = 81 and m2 = 99m3 = 99 and m4 = 99m2 = 99 and m4 = 99m4 = 81 and m1 = 81 if a man walks 16 km in 5 hours, how long would he take to walk 11.2km A rectangular garden is fenced on all sides with 278 feet of fencing. The garden is 9 feet longer than it iswide. Find the length and width of the garden. Which of the following selections most closely defines traces as it is used in the following passage?He glanced back. The other sled was coming up like an express-train. With half the dogs still over their traces, he cried, "Mush on!" and leaped upon the sled just as the pursuing team dashed abreast of him.A. noun | two straps that attach something to something elseB. noun | evidence left by someone who is fleeingC. noun | considerably small quantities of somethingD. verb | makes marks over the outline of something else on paper .The skydiver will soon open her parachute. How will her velocity change whenthe parachute first opens? Use this graph to answer. Calculate the turtles velocity during the following time intervals: 0-2 Study the photo that shows the Taj Mahal.The Taj Mahal is an example ofByzantine architecture.Ottoman architecture.Gupta architecture.Mughal architecture. I need help on this one please PLEASE HELP NOW PLEASE!!!!!!!!!!!Eli found the same jacket he wants to buy at four different stores. Each of the stores is offering discounts for the holiday weekend. Place the store letters in the boxes to show the sales price of the jacket from least to greatest.A. Store A, Store C, Store B, Store DB. Store A, Store B, Store C, Store DC. Store C, Store A, Store D, Store BD. Store B, Store D, Store A, Store C