answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Marina CMI
2 months ago
9

3. Rajat wants to assign green colour to a paragraph. Write the code that will help him in completing the task

Computers and Technology
1 answer:
Amiraneli [1K]2 months ago
4 0

Explanation:

apply the style attribute

You might be interested in
Define a function PrintFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand.
Natasha_Volkova [1026]

Answer:

I'm developing a function in C++. If you need it in a different programming language, just let me know.

void PrintFeetInchShort(int numFeet, int numInches){

   cout<<numFeet<<"\' "<<numInches<<"\"";

This function requires two integers, numFeet and numInches, as arguments. It employs cout to output the value of numFeet followed by a single quote, and subsequently the value of numInches, completed with double quotes. The character \ is utilized to introduce double quotes in the output. While using a backslash before a single quote isn't necessary, you could easily write cout<<numFeet<<"' " to display a single quote without it. However, the inclusion of backslash is essential for double quotes.

Explanation:

Here's the entire program to demonstrate how the function operates.

#include <iostream> // used for input and output operations

using namespace std;   // to enable usage of cout and cin without specific qualifying prefix

void PrintFeetInchShort(int numFeet, int numInches){

// function for printing in shorthand using ' and '

   cout<<numFeet<<"\' "<<numInches<<"\""; }

int main() { // beginning of main() body

  PrintFeetInchShort(5, 8);    }

// invokes PrintFeetInchShort() with arguments of 5 for //numFeet and 8 for numInches

To prompt the user for values of numFeet and numInches, do the following:

int main() {

   int feet,inches; // declares two integer type variables

   cout<<"Enter the value for feet:"; // asks user to provide the feet measurement

   cin>>feet; // inputs the feet value from user

   cout<<"Enter the value for inch:"; // asks user to provide the inch measurement

   cin>>inches;     // inputs the inch value from user

  PrintFeetInchShort(feet, inches);   } // invokes PrintFeetInchShort()

The screenshot of the program output has been attached.

5 0
2 months ago
On the planet Sigma, robots excavate chunks of a very precious cristaline. These chunks can be divided into smaller part only on
Amiraneli [1052]

Answer:

Begin the algorithm by assessing the ship's weight. Load the crystalline material onto the ship. Verify if the weight equals the ship's weight plus k pounds of crystalline; if it is not enough, load additional crystalline. If there is an excess, discard the surplus crystalline. Upon meeting the required weight, the ship can depart for planet Sigma.

Explanation:

The algorithm consistently monitors the ship's weight while loading with the total of the ship's weight along with k pounds of crystalline. This method ensures that the ship carries the maximum feasible amount of crystalline to planet Sigma.

7 0
2 months ago
Sophie often makes grammatical errors in her document. Which feature of the Spelling and Grammar tool can she use to understand
ivann1987 [1066]

Given that Sophie frequently commits numerous spelling and grammar mistakes in her document, it would be beneficial for her to utilize a function provided by Microsoft Word that assists her in recognizing her errors, which is what (D) Explain accomplishes.

Explain would indicate to Sophie the portions of her sentences that are incorrect, the words that were mistyped, and offer suggestions for better phrasing to prevent fragmented sentences.

8 0
2 months ago
Read 2 more answers
Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input.
Amiraneli [1052]

Answer:

In C++:

#include <iostream>

#include <string>

#include <sstream>

using namespace std;

int main(){

   string lname, fname, stringnum;    int num; string login, pwd;

   cout<<"Last Name: ";    cin>>lname;

   cout<<"First Name: ";    cin>>fname;

   cout<<"Four-digit integer: ";    cin>>num;

   stringnum = to_string(num).substr(0, 4);

   stringstream geek(stringnum);    geek>>num;

   num = num%100;

   pwd = to_string(num);

   if(lname.length()<5){ login = lname + fname.substr(0, 1);    }

   else{ login = lname.substr(0, 5) + fname.substr(0, 1);    }

   cout<<"Login Name: "<<login<<endl;

   cout<<"Password: "<<pwd<<endl;

   return 0;

}

Explanation:

This initializes all the required variables

   string lname, fname, stringnum;    int num;     string login, pwd;

This asks the user for their last name

   cout<<"Last Name: ";    cin>>lname;

This asks for the first name of the user

   cout<<"First Name: ";    cin>>fname;

This prompts for a four-digit number

   cout<<"Four-digit integer: ";    cin>>num;

This converts the number into a string and extracts the first four digits

   stringnum = to_string(num).substr(0, 4);

This changes the string back into an integer

   stringstream geek(stringnum);    geek>>num;

This extracts the last two digits of the four-digit number

   num = num%100;

This generates the user's password

  pwd = to_string(num);

This constructs the user's login name.

This block runs if the last name has fewer than five letters

   if(lname.length()<5){ login = lname + fname.substr(0, 1);    }

This block runs otherwise

   else{ login = lname.substr(0, 5) + fname.substr(0, 1);    }

This displays the login name

   cout<<"Login Name: "<<login<<endl;

This displays the password

   cout<<"Password: "<<pwd<<endl;

3 0
2 months ago
Write the pseudocode that determines the change to be dispensed from a vending machine. An item in the machine can cost between
Amiraneli [1052]

Answer:

input price

set change to one hundred minus price

set quarter to change divided by 25

set change to change mod 25

set dime to change divided by 10

set change to change mod 10

set nickel to change divided by 5

set change to change mod 5

set penny to change

print "You acquired an item for price cents and paid me a dollar. Your change is: "

if quarter is equal to 1

print quarter

else if quarter is greater than 1

print quarter with "quarters"

if dime is equal to 1

print dime

else if dime is greater than 1

print dime with "dimes"

if nickel is equal to 1

print nickel

else if nickel is greater than 1

print nickel with "nickels"

if penny is equal to 1

print penny

else if penny is greater than 1

print penny with "pennies"

Explanation:

A clearer way to express the pseudocode above could involve using alternative names for change as:

input price

set change to one hundred minus price

set quarter to change divided by 25

set quarter_remainder to change mod 25

set dime to quarter_remainder divided by 10

set dimes_remainder to quarter_remainder mod 10

set nickel to dimes_remainder divided by 5

set nickel_remainder to dimes_remainder mod 5

set penny to nickel_remainder

print "You purchased an item for" price"cents and provided a dollar. Your change is: "

if quarter is equal to 1

print quarter "quarter"

else if quarter is greater than 1

print quarter "quarters"

if dime is equal to 1

print dime "dime"

else if dime is greater than 1

print dime "dimes"

if nickel is equal to 1

print nickel "nickel"

else if nickel is greater than 1

print nickel "nickels"

if penny is equal to 1

print penny "penny"

else if penny is greater than 1

print penny "pennies"

Next, I will illustrate the pseudocode through an example:

Let's assume price = 75

Thus, change = 100 - price = 100 - 75 = 25

change = 25

quarter = change/25 = 25/25 = 1

quarter = 1

quarter_remainder = change % 25 = 25%25 = 0

dime = 0/10 = 0

At this point, all additional values are 0.

The following message will be displayed on the screen:

You acquired an item for 75 cents and paid me a dollar. Your change is:

Now the program proceeds to the conditional statement

if quarter == 1

This condition holds true because the value of quarter is 1

print quarter "quarter"

Subsequently, this line will appear on the screen:

1 quarter

Thus, the full output of the pseudocode is:

You acquired an item for 75 cents and paid me a dollar. Your change is:

1 quarter

6 0
1 month ago
Other questions:
  • Assume a program requires the execution of 50 x 106 FP instructions, 110 x 106 INT instructions, 80 x 106 L/S instructions, and
    9·1 answer
  • 6. Write pseudo code that will perform the following. a) Read in 5 separate numbers. b) Calculate the average of the five number
    6·1 answer
  • What are the 2 things you are not sure about evaluating functions​
    7·2 answers
  • Consider a load-balancing algorithm that ensures that each queue has approximately the same number of threads, independent of pr
    14·1 answer
  • Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, a
    10·1 answer
  • What advantage do ExpressCard modules and USB adapters offer over expansion cards?
    5·1 answer
  • Danielle, a help desk technician, receives a call from a client. In a panic, he explains that he was using the Internet to resea
    9·1 answer
  • 5) [4 points] Suppose you have a simple computer that is capable of storing only the months of the year. The number of bits avai
    12·1 answer
  • Which of the following image file formats uses lossy file compression?
    7·1 answer
  • Consider a set A = {a1, . . . , an} and a collection B1, B2, . . . , Bm of subsets of A (i.e., Bi ⊆ A for each i). We say that a
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!