1answer.
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
Flura [38]
3 years ago
5

The Thing method printMessage prints a string consisting of the name of the object followed by "_is_great". Suppose the name of

the Thing object favFood is "pizza". Write a statement that uses the printMessage method to print the string "pizza_is_great". Write the statement below.
Computers and Technology
1 answer:
Harman [31]3 years ago
4 0

Answer:

Written in C++

The statement that prints the required output is:

<em>printMessage(favFood); </em>

Explanation:

The full program is with comment is:

#include<iostream>

using namespace std;

//The method begins here

void printMessage(string favFood){

//This line prints the required output

cout<<favFood<<"_is_great";

}

//The main method starts here

int main()

{

//This line declares favFood as string

string favFood;

//This line prompts user for input

cout<<"Food: ";

//This line gets the input

cin>>favFood;

//This line calls the printMessage method

printMessage(favFood);

return 0;

}

You might be interested in
Coupon collector is a classic statistic problem with many practical applications. The problem is to pick objects from a set of o
ahrayia [7]

Answer:

Here is the JAVA program:

public class Main {  //class name

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

//sets all boolean type variables spades, hearts diamonds and clubs to false initially

   boolean spades = false;  

   boolean hearts = false;

   boolean diamonds = false;

   boolean clubs = false;  

   String[] deck = new String[4];  //to store card sequence

   int index = 0;  //to store index position

   int NoOfPicks = 0;  //to store number of picks (picks count)

   while (!spades || !hearts || !diamonds || !clubs) {   //loop starts

       String card = printCard(getRandomCard());  //calls printCard method by passing getRandomCard method as argument to it to get the card

       NoOfPicks++;   //adds 1 to pick count

       if (card.contains("Spades") && !spades) {  //if that random card is a card of Spades and spades is not false

           deck[index++] = card;  //add that card to the index position of deck

           spades = true;  //sets spades to true

       } else if (card.contains("Hearts") && !hearts) {  //if that random card is a card of Hearts and hearts is not false

           deck[index++] = card;  

           hearts = true;   //sets hearts to true

       } else if (card.contains("Diamond") && !diamonds) {  //if that random card is a card of Diamond and diamonds is not false

           deck[index++] = card;

           diamonds = true;  //sets diamonds to true

       } else if (card.contains("Clubs") && !clubs) {  if that random card is a card of Clubs and clubs is not false

           deck[index++] = card;

           clubs = true;         }     }   //sets clubs to true

   for (int i = 0; i < deck.length; i++) {  //iterates through the deck i.e. card sequence array

       System.out.println(deck[i]);     }  //prints the card number in deck

   System.out.println("Number of picks: " + NoOfPicks);  }   //prints number of picks

public static int getRandomCard() {  //gets random card

   return (int) (Math.random() * 52); }   //generates random numbers of 52 range

public static String printCard(int cardNo) {   //displays rank number and suit

   String[] suits = { "Spades", "Hearts", "Diamonds", "Clubs", };  //array of suits

   String[] rankCards = { "Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10",

           "Jack", "Queen", "King" };   //array of rank

  int suitNo = cardNo / 13;  //divides card number by 13 and stores to suitNo

 int rankNo = cardNo % 13;   //takes modulo of card number and 13 and store it to rankNo

   return rankCards[rankNo] + " of " + suits[suitNo];  }}  //returns rankCard at rankNo index and suits at suitNo index

Explanation:

The program is explained in the comments attached with each line of code. The screenshot of the program along with its output is attached.

8 0
3 years ago
State 3 file formats explain them in an understanding manner apart from Microsoft word and PDF
natita [175]

Answer:

Hope below explanations are enough.

Explanation:

1. JPEG (or JPG) - Joint Photographic Experts Group

JPEGs might be the most common file type you run across on the web, and more than likely the kind of image that is in your company's MS Word version of its letterhead. JPEGs are known for their "lossy" compression, meaning that the quality of the image decreases as the file size decreases.

You can use JPEGs for projects on the web, in Microsoft Office documents, or for projects that require printing at a high resolution. Paying attention to the resolution and file size with JPEGs is essential in order to produce a nice looking project.

2. PNG - Portable Network Graphics

PNGs are amazing for interactive documents such as web pages, but are not suitable for print. While PNGs are "lossless," meaning you can edit them and not lose quality, they are still low resolution.

The reason PNGs are used in most web projects is that you can save your image with more colors on a transparent background. This makes for a much sharper, web-quality image.

3. GIF - Graphics Interchange Format

GIFs are most common in their animated form, which are all the rage on Tumblr pages and in banner ads. It seems like every other day we have a new Grumpy Cat or Honey Boo Boo animated GIF. In their more basic form, GIFs are formed from up to 256 colors in the RGB colorspace. Due to the limited number of colors, the file size is drastically reduced.

This is a common file type for web projects where an image needs to load very quickly, as opposed to one that needs to retain a higher level of quality.

4. TIFF - Tagged Image File

A TIF is a large raster file that doesn't lose quality. This file type is known for using "lossless compression," meaning the original image data is maintained regardless of how often you might copy, re-save, or compress the original file.

Despite TIFF images' ability to recover their quality after manipulation, you should avoid using this file type on the web -- it can take forever to load. TIFF files are also commonly used when saving photographs for print.

5. PSD - Photoshop Document

PSDs are files that are created and saved in Adobe Photoshop, the most popular graphics editing software ever. This type of file contains "layers" that make modifying the image much easier to handle. This is also the program that generates the raster file types mentioned above.

The largest disadvantage to PSDs is that Photoshop works with raster images as opposed to vector images.

6 0
2 years ago
What command displays detail information about the OSPF interfaces, including the authentication method?
statuscvo [17]
<span>The answer is Show IP OSPF interface

Hope this helped :)</span>
8 0
3 years ago
Read 2 more answers
Bank of America sends out customer surveys to all of its customers asking them about the services they offer. What type of resea
ValentinkaMS [17]

Answer:

<u>Market research</u>

Explanation:

<u>Market research:</u> The term "market research" is described as a process of describing the viability of a new product or service via specific research that is being conducted directly with the different potential customers. Therefore, market research allows a specific company to discover or identify the target market and receive opinions and some other feedback from various consumers regarding their interest associated with the service or the product.

<u>In the question above, the given statement represents market research.</u>

4 0
3 years ago
Computer science is a blank process
PSYCHO15rus [73]

i agree... its a interesting thing to learn, just like learning an actual new language.

4 0
2 years ago
Read 2 more answers
Other questions:
  • You are part of the team to implement new software at XYZ Inc. The employees at XYZ Inc. trust the results of the old software p
    15·1 answer
  • Why are ethics important in PR?
    8·1 answer
  • Which types of computers are used by large businesses
    10·1 answer
  • is a private connection of LANs and WANs that belongs to an organization, and is designed to be accessible only by the members a
    14·1 answer
  • I need more friends plz talk with me
    6·2 answers
  • Hey im b---o---r---e---d dont report cuz if u do ur l a m e :)
    14·1 answer
  • 35 POINTS
    10·1 answer
  • Laura is filming a scene in which the subject is sitting with a lit fireplace behind him. The only other source of light in the
    15·1 answer
  • The four differences between binary and denary​
    13·1 answer
  • Are there any Potential Dangers in Artificial Intelligence?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!