Answer:
Here is the C++ program:
#include <iostream> //to use input output functions
#include <cstring> //to manipulate C-strings
#include <string> //to manipulate strings
using namespace std; //to access objects cin cout
//function prototypes
void upper(char *); to convert to upper case
void lower(char *); //to convert to lower case
void reverse(char *); //to convert to reverse case
int main() { //start of main method
char input[101]; //creates a char type array to hold input string
cout << "Enter a string: "; //prompts user to enter a string
cin.getline(input, 101); //reads input string from user
upper(input); //calls upper() method to convert the string to upper case
lower(input); //calls lower() method to convert the string to lower case
reverse(input); } //calls reverse() method to convert the string to reverse case
void upper(char *cString){ //method that takes a pointer to a C-string as it's only argument and converts that string to upper case
cout << "String in upper case: "; //displays string in upper case
for(int i = 0; i < strlen(cString); i++){ //iterates through the input string cString until the length of the cString is reached
if(islower(cString[i])) //checks if the character at i-th index of cString is in lower case
cout << (char) toupper(cString[i]); //converts each i-th character of cString to upper case at each iteration
else //if no character of cString is in lower case
cout << cString[i]; } //displays the cString as it is
cout << endl;} //prints a new line
void lower(char *cString){ //method that takes a pointer to a C-string as it's only argument and converts that string to lower case
cout << "String in lower case: "; //displays string in lower case
for(int i = 0; i < strlen(cString); i++){ //iterates through each character using for loop first character to last
if(isupper(cString[i])) //checks if the character at i-th index of cString is in upper case
cout << (char) tolower(cString[i]); //converts each i-th character of cString to lower case at each iteration
else //if no character of cString is in upper case
cout << cString[i]; } //displays the cString as it is
cout << endl; } //prints a new line
void reverse(char *cString){ //method that takes a pointer to a C-string as it's only argument and converts that string to reverse case (upper to lower and vice versa)
cout << "String in reverse case: "; //displays string in reverse case
for(int i = 0; i < strlen(cString); i++){ //iterates through each character using for loop first character to last
if(isupper(cString[i])) //checks if the character at i-th index of cString is in upper case
cout << (char) tolower(cString[i]); //converts character at i-th position of cString to lower
else //if the character is in lower case
cout << (char) toupper(cString[i]); } //converts character at i-th position of cString to upper
cout << endl;} //prints a new line
Explanation:
I will explain the program with an example.
Lets suppose user enters "hi" as input. So
Now first upper() method is called by passing this C-string to it.
It has a for loop that checks at each iteration, if a character of C-string is in lower using islower method which returns true if the character is in lower case. Since both the characters 'h' and 'i' are in lower in case so they are converted to upper case at each iteration using toupper() method. So the output of this part is:
String in upper case: HI
Now next lower() method is called by passing this C-string to it.
It has a for loop that checks at each iteration, if a character of C-string is in upper using isupper method which returns true if the character is in upper case. Since both the characters 'h' and 'i' are in lower in case so the string remains as it is. So the output of this part is:
String in lower case: hi
Now next reverse() method is called by passing this C-string to it.
It has a for loop that checks at each iteration, if a character of C-string is in upper using isupper method which returns true if the character is in upper case. Since both the characters 'h' and 'i' are in lower so else part: cout << (char) toupper(cString[i]); executes which converts these characters to upper case (reverse case). So the output of this part is:
String in reverse case: HI
The screenshot of program output with a different example is attached.
Lee has finished formatting his table. He wants to import an Excel table to show the density and mean temperature data of the terrestrial planets.
Which tab should he navigate to?
Which command group should he use?
Which option should he click?
Which button should he click first in the dialog box that opens?
Answer:
1. Insert
2. Text
3. Object
4. Create from file
Explanation:
On edg
After formatting his Excel table, Lee should navigate to the Insert tab and use the text command group.
What is an Excel table?An Excel table can be defined as a rectangular range of data in a spreadsheet document, which comprises cells that are typically arranged by using rows and columns.
In this scenario, Lee should navigate to the Insert tab and use the text command group after formatting his Excel table.
Also, an option which he click is object while clicking on the "create from file" button in the dialog box that opens.
Read more on Excel table here: https://brainly.com/question/13776450
#SPJ2
Let's play Silly Sentences!
Enter a name: Grace
Enter an adjective: stinky
Enter an adjective: blue
Enter an adverb: quietly
Enter a food: soup
Enter another food: bananas
Enter a noun: button
Enter a place: Paris
Enter a verb: jump
Grace was planning a dream vacation to Paris.
Grace was especially looking forward to trying the local
cuisine, including stinky soup and bananas.
Grace will have to practice the language quietly to
make it easier to jump with people.
Grace has a long list of sights to see, including the
button museum and the blue park.
Answer:
Grace sat quietly in a stinky stadium with her blue jacket
Grace jumped on a plane to Paris.
Grace ate bananas, apples, and guavas quietly while she listened to the news.
Grace is the name of a major character in my favorite novel
Grace was looking so beautiful as she walked to the podium majestically.
Grace looked on angrily at the blue-faced policeman who blocked her way.
What steps should a user take to create a secondary address book?
Open the Backstage view and Account Settings.
Open the Backstage view, and click People options.
Open the People view, and click New Address Book.
Open the People view, click Folder tab, and click New Folder.
Answer:
It's A
Explanation:
correct on edg
Answer:
A is correct on edg
Explanation:
What is an instance of a computer program that is being executed?
1. Processing
2. Storage
3. Input
4. App
2
Select the correct answer from each drop-down menu.
Different web browsers perform similar
functions, which are presented in the form of?
A. Text labels
B. Webpages
C. Buttons and menus
Answer:
The answer to this question is given below in the explanation section.
Explanation:
The correct answer to this question is B.
Because different browsers perform similar functions that are presented in the form of webpages. If you want to run the webpage in chrome, it will run similarly as you run it in internet explorer or in firefox.
However, other options such as text labels and buttons and menus are not the browser functions because these are the elements of the webpages.
so the correct answer to this question is webpages.
A user is asked to type a caption for a photo in a web form's text field. If the caption didn't end with a punctuation mark (. ! ?), a period should automatically be added. A common error is to end with a comma, which should be replaced by a period. Another common error is to end with two periods, which should be changed to one period (however, ending with three periods (or more) indicates elipses so should be kept as is). The corrected caption is output. If the input is "I like pie", the output is "I like pie." If the input is "I like pie!", the output remains "I like pie!" If the input is "Coming soon…", the output remains "Coming soon…"
Answer:
Here is the c++ program:
#include <iostream> //to use input output functions
using namespace std; //to identify objects cin cout
int main() { //start of main function
string caption; //stores the caption
int last_index; //stores the index position of the last character of caption
char last_character; //stores the last character of the caption
cout<<"Please type a caption: "; //prompts user to enter a caption
getline(cin, caption); //reads the complete line of caption from user
last_index = caption.size() - 1; //sets the last_index to the last character of caption
last_character = caption.at(last_index); //sets the last_character to the last character positioned by last_index
if ((last_character == '!') || (last_character == '?')) {} /* checks if the last character of the caption is either ! or ? and if this statement evaluate to true then this does not require any action */
else if (last_character == ',') { //checks if the last character of the caption is a comma
caption.at(last_index) = '.'; } //if the else if condition is true then replace that comma with a period .
else if (last_character != '.') { //checks if the caption does not end with ! ? , .
caption.push_back('.');} //append period to the caption . if above if else condition is true
else if ((last_index > 0) && (last_character == '.') && (caption.at(last_index - 1) == '.')) { //checks if the caption has two periods .
if ((last_index > 1) && (caption.at(last_index - 2) == '.')) {} //checks if the caption has three periods and does nothing if this is true
else { //if caption has two periods
caption.pop_back();}} //removes one period if caption has two periods .
cout << caption << endl;} //displays the caption
Explanation:
I will explain the above program with an example
Lets say user input the caption: I like pie
So
caption = " I like pie"
The first if condition if ((last_character == '!') || (last_character == '?')) evaluate to false because the last character of the caption is not an exclamation mark of a question mark. So the program moves to the next else if statement:
else if (last_character == ',') This statement is also false because the last character of the caption is not a comma. So the program moves to the next else if part.
else if (last_character != '.')
Now this statement evaluate to true because the last character of the caption is not a period . sign. So this part is executed. It has a statement:
caption.push_back('.');
Now this statement uses push_back() method which adds new character i.e. period '.' at the end of the caption string, increasing its length by one.
So the output of the program is:
I like pie.
If the caption = " I like pie!" then this if ((last_character == '!') || (last_character == '?')) condition executes and since it does nothing {} so the caption remains as it is and the output is:
I like pie!
If the caption = "Coming soon…" then this else if ((last_index > 0) && (last_character == '.') && (caption.at(last_index - 1) == '.')) condition executes which checks if the caption has two period. When this condition evaluates to true then the statement inside this else if condition executes which is: if ((last_index > 1) && (caption.at(last_index - 2) == '.')) and this checks if the caption has three periods. Yes the caption has three periods so it does nothing and the caption remains as it is and the output is:
Coming soon…
However if the caption is Coming soon.. with two periods then the else part inside else if ((last_index > 0) && (last_character == '.') && (caption.at(last_index - 1) == '.')) condition executes which is: caption.pop_back(); and this removes one period from the caption and the output is:
Coming soon.
The screenshot of the program and its output is attached.
In programming, what is a floating-point number?
A number with a decimal, Option A
essay regarding a magic cell phone that turns into robot
It should be noted that when writing an essay, it's important to effectively present the information to the readers.
Writing an essay.When writing the essay, the following steps are required:Create an essay outline.It's important to also develop a thesis statement.Introduce the topic.Then, write the body of the message The conclusion should be presented.It should be noted that when writing the essay, it's also important to integrate the evidence clearly and ensure that the grammar used is correct.
Learn more about essays on:
https://brainly.com/question/25607827
how would you share information and communicate news and events
Answer:
You could use Print things (mail, books, etc.) or Online things (internet, social media, etc.)
Hope this helps :)
Write both an iterative and recursive solution for the factorial
problem.
Answer:
Explanation:
Recursive:
C++ program to find factorial of given number
#include <iostream>
using namespace std;
unsigned int factorial(unsigned int n)
{
if (n == 0)
return 1;
return n * factorial(n - 1);
}
// Driver code
int main()
{
int num = 5;
cout << "Factorial of "
<< num << " is " << factorial(num) << endl;
return 0;
Iterative:
// C++ program for factorial of a number
#include <iostream>
using namespace std;
unsigned int factorial(unsigned int n)
{
int res = 1, i;
for (i = 2; i <= n; i++)
res *= i;
return res;
}
// Driver code
int main()
{
int num = 5;
cout << "Factorial of "
<< num << " is "
<< factorial(num) << endl;
return 0;
}
Which of the following statements best
describes a high level language?
A. The syntax is all 1's and O's.
B. The syntax is English-like.
C. All high level languages look the same.
D. High level languages are the most difficult to understand.
Answer
b
Explanation:
If you are wanting to change programs, when do you need to make this request?
a.To change programs, you must contact your advisor or counselor and complete the change of program application during an open application window.
b.You can change at any time; just email your advisor regarding the change.
c.You can never change programs.
d.You do not need to notify anyone. You just need to start taking courses for the desired program.
Answer:
If your discussing colleges and degrees, you cant take courses your not autorized to take.
So if you have one major and wish to change to another then you need to discuss with a student advisor or counseler so they can make the changes. They will also discuss which classes are necessary for your program of choosing, making sure all your requirements are completed.
Explanation:
HEY DO U LIKE TRAINS!
Answer:
yes
Explanation:
yes
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
Answer:
c
Explanation:
In the insert table of figures dialog box which drop down menu do you use to choose what information is displayed in the table
Answer:
caption label
Explanation:
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.
To insert the footer according to her plan, what must Gloria click in the Header & Footer dialog box?
Fixed
Preview
Slide number
Don’t show on title slide
Answer:
Its D
Explanation:
On edg
Answer: don’t show on title slide
Explanation:
Describe yourself as a programming object and give at least 5 properties and 5 methods that you think you are equipped with.
Answer:
The answer to this question is given below in the explanation section.
Explanation:
I consider myself a programming object, then the following are my properties and methods.
Properties (represents the features)
name.height.weight.skin color.eye color,hair styleMethods (represents the behavior)
Walk.Eat,ListenSpeakDrinkWhat weight pencil is recommended for darkening lines and for lettering? *
Answer: darkened
Explanation: darkened
Answer:
While the softer B pencils are generally considered the best for shading, there's no reason to discount the harder H pencils. The HB and H are good choices for fine, light, even shading. However, they too have drawbacks. Pencil grades from HB through H, 2H to 5H get progressively harder and are easier to keep sharp.
• Open your Netbeans IDE and answer the following question
• Create a folder on the desktop. Rename it with your student name and student number
• Save your work in the folder you created.
At a certain store they sell blank CDs with the following discounts:
* 10% for 120 or more
* 5% for 50 or more
* 1% for 15 or more
* no discount for 14 or less
Write a program that asks for a number of discs bought and outputs the correct discount. Use either a switch statement or if..elseif.. ladder statements. Assuming that each blank disk costs N$3.50. The program should then calculate the total amount paid by the buyer for the discs bought.
Answer:
public static void main(String[] args)
{
int cdCount;
double cdCountAfterDiscount;
DecimalFormat df = new DecimalFormat("$##.##"); // Create a Decimal Formatter for price after discount
System.out.println("Enter the amount of CD's bought");
Scanner cdInput = new Scanner(System.in); // Create a Scanner object
cdCount = Integer.parseInt(cdInput.nextLine()); // Read user input
System.out.println("CD Count is: " + cdCount); // Output user input
if(cdCount <= 14 )
{
System.out.println("There is no discount");
System.out.println("The final price is " + cdCount*3.5);
}
if(cdCount >= 15 && cdCount<=50)
{
System.out.println("You have a 1% discount.");
cdCountAfterDiscount = (cdCount *3.5)-(3.5*.01);
System.out.println("The final price is " + df.format(cdCountAfterDiscount));
}
if(cdCount >= 51 && cdCount<120)
{
System.out.println("You have a 5% discount.");
cdCountAfterDiscount = (cdCount *3.5)-(3.5*.05);
System.out.println("The final price is " + df.format(cdCountAfterDiscount));
}
if(cdCount >= 120)
{
System.out.println("You have a 10% discount.");
cdCountAfterDiscount = (cdCount *3.5)-(3.5*.1);
System.out.println("The final price is " + df.format(cdCountAfterDiscount));
}
}
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
.
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
This needs to be written in Java.
Create an Automobile class for a dealership. Include fields for an ID number, make, model, color, year, vin number, miles per gallon, and speed. Include get and set methods for each field. Do not allow the ID to be negative or more than 9999; if it is, set the ID to 0. Do not allow the year to be earlier than 2000 or later than 2017; if it is, set the year to 0. Do not allow the miles per gallon to be less than 10 or more than 60; if it is, set the miles per gallon to 0. Car speed should be initialized as 0. Include a constructor that accepts arguments for each field value and uses the set methods to assign the values. Also write two methods, Accelerate () and Brake (). Whenever Accelerate () is called, increase the speed by 5, and whenever Brake () is called, decrease the speed by 5. To allow users to specify the speed to increase (or decrease), create two overloading methods for Accelerate () and Brake () that accept a single parameter specifying the increasing (or decreasing) speed. Write an application that declares several Automobile objects and demonstrates that all the methods work correctly. Save the files as Automobile.java and TestAutomobiles.java
Answer:
Here is Automobile.java
class Automobile { //class name
private int ID, year, milesPerGallon, speed = 0; // private member variables of Automobile of int type
private String model, vinNo, make, color; // private member variables of Automobile of String type
public void setID(int ID){ //mutator method to set ID
if (ID >= 0 && ID <= 9999) // checks ID should not be negative or more than 9999
this.ID = ID;
else this.ID = 0; } //if ID is negative or greater than 9999 then set ID to 0
public void setModel(String model){ // mutator method to set model
this.model = model; }
public void setYear(int year){// mutator method to set year
if (year >= 2000 && year <= 2017) //checks that year should not be earlier than 2000 or later than 2017
this.ID = ID;
else this.year = 0; } //if year is less than 2000 or greater than 2017 then set year to 0
public void setVinNo(String vinNo){ //mutator method to set vin number
this.vinNo = vinNo; }
public void setMilesPerGalon(int milesPerGallon){ //mutator method to set miles per gallon
if (milesPerGallon >= 10 && year <= 60) //checks that miles per gallon should not be less than 10 or more than 60
this.milesPerGallon = milesPerGallon;
else this.milesPerGallon = 0; } //if it is more than 60 or less than 10 then set miles per gallon to 0
public void setSpeed(int speed){ //mutator method to set speed
this.speed = speed; }
public void setMake(String make){ //mutator method to set make
this.make = make; }
public void setColor(String color){ //mutator method to set color
this.color = color; }
public int getID() //accessor method to get or access ID
{return ID;} //returns the current ID
public String getModel() //accessor method to get or access model
{return model;} //returns the current model
public int getYear()// accessor method to get or access year
{return year;} //returns the current year
public String getVinNo() // accessor method to get or access vin number
{return vinNo;} //returns the current vin number
public int getMilesPerGallon() //accessor method to get or access miles per gallon
{return milesPerGallon;} //returns the current miles per gallon
public int getSpeed() //accessor method to get or access speed
{return speed;} //returns the current speed
public String getMake() //accessor method to get or access make
{return make;} //returns the current make
public String getColor() //accessor method to get or access color
{return color;} //returns the current color
public int Accelerate() { //method that increase speed by 5
setSpeed(speed + 5); //calls set speed to add 5 to the speed field
return speed; } //returns the speed after increasing 5
public int Brake() { //method that decreases speed by 5
setSpeed(speed - 5);//calls set speed to subtract 5 from the speed field
return speed; } //returns the speed after decreasing 5
public int Accelerate(int spd) { //overloading methods for Accelerate()that accepts a single parameter spd
setSpeed(speed + spd); //increases speed up to specified value of spd
return speed; }
public int Brake(int spd) { //overloading methods for Brake()that accepts a single parameter spd
setSpeed(speed - spd); //decreases speed up to specified value of spd
return speed; }
public Automobile(int ID, String make, String model, int year, String vinNo, int milesPerGallon, int speed, String color){ //constructor that accepts arguments for each field value and uses the set methods to assign the values
setID(ID);
setModel(model);
setYear(year);
setVinNo(vinNo);
setMilesPerGalon(milesPerGallon);
setSpeed(speed);
setMake(make);
setColor(color); } }
Explanation:
Here is TestAutomobiles.java
public class TestAutomobiles { //class name
public static void main(String args[]) { //start of main method
Automobile auto = new Automobile(123, "ABC", "XYZ", 2010, "MMM", 30, 150, "White"); //creates an object of Automobile class and calls its constructor passing the values for each of the fields
System.out.println("Initial Speed: " + auto.getSpeed()); //calls getSpeed method to get the current speed using object auto. The current speed is 150
System.out.println("Speed after applying acceleration: " + auto.Accelerate()); //calls Accelerate() method to increase the current speed to 5
System.out.println("Speed after applying brake: " + auto.Brake()); //calls Brake() method to decrease the current speed to 5
System.out.println("Speed after applying acceleration: " + auto.Accelerate(180)); //calls overloading Accelerate() method to increase the current speed to 180
System.out.println("Speed after applying brake: " + auto.Brake(50)); } } //calls overloading Brake() method to decrease the current speed to 50
//The screenshot of the output of the program is attached.
To close a window in Windows 10, you can _____. Select all that apply. A. right-click its button on the taskbar, then click Close window B. click the Close button in the upper-right corner of the window C. click the Close button in the window's thumbnail on the taskbar D. click the Start button and click the program name or icon
Answer:
A, B and C
Explanation:
A, B and C
(The following is unrelated to the answer just to fill the letters criteria)
For closing the window in Windows 10, the following steps should be considered:
The right-click should be done on the taskbar and then click on the close window.On the upper-right corner of the window, click on the close button.On the window thumbnail that shows on the taskbar, click on the close button.Now if we click on the start button and then click the program icon so the particular program opens instead of closing it.
Therefore the above steps are considered for closing out the window in windows 10.
Learn more about windows 10 here: /brainly.com/question/19652025
Is Zero (Sam Fisher, Rainbow Six Siege version of course) overpowered because of the fact he has a gun that does 45 damage at a fire rate of 800rpm
Answer:
Yes
Explanation:
I see his damage and rpm as unfair because of the fact that he can deal over 36,000 damage in one minute.
Please Help Me
What kinds of solutions are proposed for different IT issues, and what are their advantages and disadvantages?
Answer:
There are three basic forms of business ownership: sole proprietorship, partnership and corporation. Each of these forms of business organization has advantages and disadvantages in such areas as setting up the company, paying taxes and assessing liability for business debts
The graphical user interface (GUI) was pioneered in the mid-1970s by researchers at:
A) Apple Computer
B) Microsoft
C) Xerox
D) IBM
Answer:
its C actually
Explanation:
C) Xerox plus i had a quiz
Answer:
xerox
Explanation:
Read each description below, and then choose the correct term that matches the description from the drop-down menus.
wireless technology that lets you identify and track objects
medical uses of RFID
a low-power radio wave used for short distances
computing device used with Bluetooth Read each description below, and then choose the correct term that matches the description from the drop-down menus.
wireless technology that lets you identify and track objects
medical uses of RFID
a low-power radio wave used for short distances
computing device used with Bluetooth
Answer:
wireless technology that lets you identify and track objects (radio frequency identification)
medical uses of RFID (patient identification)
a low-power radio wave used for short distances (bluetooth)
computing device used with Bluetooth hands-free microphone in car
Explanation:
sorry if late :/
Answer:
Explanation:
edg 2021
2. What types of news can be created?
Answer:
Print Media
Broadcast Media
Explanation:
Common lossless compressed audio file formats include
WMA and JIFF
WAV and AU
MP3 and MP4a
FLAC and ALAC
Answer:
The answer to this question is given below in the explanation section. The forth one (FLAC and ALAC) is the correct option.
Explanation:
Common lossless compressed audio file formats include
WMA and JIFF WAV and AU MP3 and MP4a FLAC and ALACLossless compression formats include the common FLAC, WavPack, Monkey's Audio, ALAC (Apple Lossless). Other options are not common lossless compressed audio formats.
Answer:d d
Explanation:
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
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]);
}
CNT Books has expanded considerably since you got the network up and running three years
ago. It now occupies an entire floor in the building, and its LAN has grown to include several
servers and more than 60 workstations.
CNT Books has recently purchased another book company and needs more space and
computers. Expansion plans include leasing another floor four stories above the current offices
in the same building and adding 35 workstations and at least one more server immediately,
with additional equipment purchases expected. [15 marks]
i. What type of network is called for—LAN, WAN, MAN, or internetwork?
Answer:
The answer to this question is given below in the explanation section
Explanation:
CNT Books has expanded considerably since you got the network up and running three years ago. It now occupies an entire floor in the building, and its LAN has grown to include several servers and more than 60 workstations.
CNT Books has recently purchased another book company and needs more space and computers. Expansion plans include leasing another floor four stories above the current offices in the same building and adding 35 workstations and at least one more server immediately, with additional equipment purchases expected.
The type of networking CNT Book will use is WAN.
LAN
A local area network (LAN) is a group of computers and peripheral devices that share a common communications line or wireless link to a server within a distinct geographic area. A local area network may serve as few as two or three users in a home-office or several hundred users in a corporation's central office
WAN
A wide area network (WAN) is a geographically distributed private telecommunications network that interconnects multiple local area networks (LANs). A LAN is a group of computers and network devices which are all connected to each other, typically from within a short relative geographical distance.
MAN
A metropolitan area network is a computer network that interconnects users with computer resources in a geographic region of the size of a metropolitan area.
internetworking
Internetworking is the process or technique of connecting different networks by using intermediary devices such as routers or gateway devices. Internetworking ensures data communication among networks owned and operated by different entities using a common data communication and the Internet Routing Protocol. internetworking is not a network type but it is a process or technique of connecting different networks by using intermediary devices.