How to Print output in JavaScript

Answers

Answer 1

If you want to print on a page you can use

document.write();

If you want to write in console then there are multiple options

console.log() - to log information

console.error();- to log errors

console.warn(); - to log warning message

If you want to popup some information the you can use -

alert(message);

there are also various options present in alert.

or

print() essentially just calls up the native print dialog for a given window.

But as you're are thinking, it will work on any window or (i)frame.

thus if you write content to a frame, you can then call this to print it.

window.frameName.print();

note the only drawback (and its a big one), is that this calls up the print dialog... not the print preview window... thus the user doesn't really get a chance to see what they are printing and/or scale it to fit their printer/paper.

I personally wish that all browsers would implement the following to handle the above issue.

window.printPreview();

Hope this will help !!!

Answer 2

Answer:

Just add "document.wright();" to print text.


Related Questions

Recursion is a natural use for a _____ (stack or queue)

Answers

Answer:

Stack

Explanation:

Any function that call itself can be regarded as recursive function, it should be noted that Recursion is a natural use for a stack, especially in the area of book keeping.

Recursion is very important because some of problems are usually recursive in nature such as Graph and others, and when dealing with recursion , only base and recursive case is needed to be defined.

Some areas where recursion is used are in sorting and searching.

Sorry if this is not related.


What is the best game programming language to learn?

Answers

These are my recommendations but you should just try to find the one that’s right for you ——
Python for beginners.
C++ for game development. (C# for unity game development )
html5 for web development.
Java or JavaScript for software development
I suggest you to try either Visual Studio, Python or Java and JavaScript.
Python and Java are comparingly easy.

For demultiplexing a UDP socket is identified by:_____.

Answers

Answer:

1. Destination IP address

2. Destination Port number

Explanation:

Demultiplexing is a term that describes a procedure of transforming a signal that has multiple analog or digital signal flows into different initial and unconnected signals.

Hence, in this situation, the correct answer is that for the demultiplexing process, a UDP (User Datagram Protocol) socket is identified by both the destination IP address and destination port number

C++ code pls write the code

Answers

Answer:

Following are the code to this question:

#include<iostream>//defining header file

using namespace std;

class vec//defining class vec  

{

int x, y, z; //defining integer varaible x, y, z

public: // using public access specifier

vec() //defining default constructor

{

   x = 0; //assign value 0 in x variable  

   y = 0; //assign value 0 in y variable

   z = 0;//assign value 0 in z variable

}

vec(int a, int b , int c) //defining parameterized constructor vec

{

   x = a; //assign value a in x variable

   y = b; //assign value b in y variable

   z = c;//assign value c in z variable

}

void printVec() //defining a method printVec

{

   cout<<x<<","<<y<<","<<z<<endl; //use print method to print integer variable value

}

//code

vec& operator=(const vec& ob) //defining operator method that create object "ob" in parameter  

{

x=ob.x; //use ob to hold x variable value

y=ob.y;//use ob to hold y variable value

z=ob.z;//use ob to hold z variable value

return *this;//using this keyword to return value  

}

};

int main()//defining main method

{

vec v(1,2,3);//calling parameterized constructor

vec v2; //creating class object to call method

v2=v; //creatring reference of object

v2.printVec(); //call method printVec

return 0;

}

Output:

1, 2, 3

Explanation:

In the above-given code part, a method "operator" is defined, that accepts an object or we can say that it is a reference of the class "ob", which is a constant type. Inside the method, the object is used to store the integer variable value in its variable and use the return keyword with this point keyword to return its value.    

What are the differences between an Api Controller and "regular/view" Controller in .Net?

Answers

Answer:

An API controller in .Net is a code statement or function that returns data and a RESTful API to the application while a regular or view controller is a class that returns a view.

Explanation:

The .Net framework is a platform used for creating user-friendly and user interactive interfaces in desktop and web applications. Like all programming frameworks, it uses API and API controllers to source data and other properties.

Using computer software, compare the 2016 year-to-date sales through February to the 2017 year-to-date sales through February for each manufacturer by computing the difference. Using computer software, sort the list of the manufacturers in order of largest to smallest difference in year-to-date sales. Which manufacturers are in the top five with increased sales

Answers

Incomplete question. Here's a similar question found in the attachments.

Answer:

General Motors Corp, Chrysler, Ford Motor Company, Toyota Motors sales USA Inc, Nissan North America Inc.

Explanation:

By, using the MS Excel computer software, you would be able to compare the 2016 year-to-date sales through February 2017 year-to-date sales for each manufacturer.

Simply copy the data into the data cells of MS Excel, next use the =sum formula (which should have a minus sign; For example, =SUM (B5 - E5) would give you the difference between the 2016 sales and 2017 sales, only if sales for 2016 is found in column B row 5 and sales for 2017 in column E row 5).

Thus, the results obtained can further be evaluated to determine the manufacturers in the top five with increased sales.

Write a Java program that prompts the user for an int n. You can assume that 1 ≤ n ≤ 9. Your program should use embedded for loops that produce the following output: 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1 . . . n . . . 5 4 3 2 1 Your prompt to the user should be: Please enter a number 1...9 : Please note that your class should be named PatternTwo.

Answers

Answer:

Here is the JAVA program:

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

public class PatternTwo{   //class name

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

Scanner scan = new Scanner(System.in);   // creates Scanner class object

System.out.print("Please enter a number: ");  //prompts user to enter an int n for the number of rows

int n = scan.nextInt();   //reads and scans the value of n from user

int i, j;   //declares two variables to iterate through i  rows and j columns

for (i=1; i<=n; i++){    //outer loop for rows  

for (j=2*(n-i); j>=1; j--){   //inner loop for space between numbers in pattern  

System.out.print(" ");  }   //displays an empty space in the pattern

for (j = i; j >= 1; j--)  { //inner loop for columns  

System.out.print(j+" "); }   //prints the value of j (prints numbers in reverse)

System.out.println();   }   }   }  //prints a new line after printing each row

Explanation:

The program is explained with an example in the attached document.

A DBMS commonly receives data update requests from application programs.A. TrueB. False

Answers

Answer:

A. True

Explanation:

DBMS is an acronym for database management system and it can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

Some examples of a database management system (DBMS) are RDBMS, Oracle, SQL server, PostgreSQL, dBASE, Clipper, MySQL, Microsoft Access, etc.

A DBMS commonly receives data update requests from application programs through the Open Database Connectivity ( ODBC ) driver in case of communication with other database management softwares.

Basically, when a database management system (DBMS) receives data update requests from application programs, it simply instructs the operating system installed on a server to provide the requested data or informations.

System Development Life Cycle (SDLC) defines methodology with clearly defined process of development of a system comprising of six stages including plan, analyze, design, develop, implement and maintain. A similar system was utilized when a university implemented Learning Management System in order to incorporate online learning and student facilitation portal. You are now assigned to investigate the issues faced by the students while shifting from physical learning environment to online learning environment. After investigation, develop a feasibility report to recommend what common problems will be faced by the students when shifted to new online environment?

Answers

Answer:

The answer is "The problems which students face when they have been transferred to the online environment are the popular ones".

Explanation:

Digital Literacy:

It was the first issue that can occur whenever the student shifts from either a physical to an online course. When a participant wants to get involved in the on-line class, he/she must be able to use various tools in an on-line setting-login or update and delete successfully, enroll in an online class, submit assignments on-line or communicate to professors as well as other participants in the lesson.  

Technical issues:

In colleges, students and teachers of new on-line educational systems will present many technical issues. These problems could include slow internet bandwidth and just a little time to find a more suitable Wi-Fi location to access the web.

Timing issues:

It is scheduling for learners could be of interest in which a prescribed period for performing online courses also isn't followed. Teachers might well be distracted only at school with the other family or work. Sometimes educators could also engage in many other tâches only at the prescribed time, such that he needs can inform his learners about the lesson earlier is however also an important issue while shifting to online courses.

Motivation:

Online teaching involves motivation for completion of tasks, activity, and progress. So, if students or educators weren’t motivated to be using the new system, this can be a big problem.

Answer:

The problems which students face when they have been transferred to the online environment are the popular ones

Explanation:

Write a program that simulates a lottery. The program should havean array of five integers named lottery, and shouldgenerate a random number in the range of 0 through 9 for eachelement in the array. The user should enter five digits whichshould be stored in an integer array named user. Theprogram is to compare the corresponding elements in the two arraysand keep a count of the digits that match. For example, thefollowing shows the lottery array and the user array with samplenumbers stored in each. There are two matching digits (elements 2and 4).
lottery array: 7,4,9,1,3
user array: 4,2,9,7,3
The program should display the random numbers stored in the lotteryarray and the number of matching digits. If all the digits match,display a message proclaiming the user as a grand prize winner.

Answers

Answer:

Here is the C++ program that simulates lottery:

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

using namespace std;  //to access objects cin cout

int main(){  //start of main function

int size= 5; // size of arrays

int range = 10;  //range of random numbers from 0 to 9

int user[size];  // user array

int lottery[size];  // lottery array

for(int i=0;i<size;i++)  //iterates through the array

lottery[i]=rand()%range;  // generates random number in specified range

cout<<"Enter "<<size<<" digits: ";  //prompts user to enter 5 digits

for(int i=0;i<size;i++)  //loops through the user array

cin>>user[i];  //reads input digits from user

int match=0;  //stores number of matching digits

for(int i=0;i<size;i++)  //iterates through array to compare user and lottery arrays

if(user[i]==lottery[i])  //if digit at i-th index of user array matches to that of lottery array

match++;  //increments count of matching digits by 1

cout<<"Lottery array: ";  // display digits of lottery array

for(int i=0;i<size;i++)  //iterates through elements of lottery array

cout<<lottery[i]<<" ";  //prints elements of lottery array with a space between them

cout<<endl;  //prints a new line

cout<<"  User  array: ";  // prints digits of user array

for(int i=0;i<size;i++) //iterates through elements of user array

cout<<user[i]<<" ";  //prints elements of user array

cout<<endl;  // prints a new line

if(match==size){  //if all the digits match

cout<<"Congratulations. You are a grand prize winner! "; }//displays this message proclaiming the user as a grand prize winner

else{  // if all digits of user array do not match with lottery array digits

cout<<"Number of digits matched: "<<match<<endl; //displays the number of matched digits

cout<<"Sorry! Better luck next time!" ;    //displays this message when all digits don't match

}

}    

Explanation:

If you want to keep the size and range fixed then you can use #define before the main() function to give a constant value to size and range as:

#define size 5

#define range 10

The program uses rand() function in order to generate random numbers for lottery array in the range of 0 through 9.

Then the program declares a user array with size = 5 and prompts user to enter 5 digits to stores in user array.

Next the program matches each digit of user array to the corresponding digit of lottery array and if the two digits match then the program increments the match variable by 1 to count the matched digits. For example, lets say lottery has the following elements:

lottery: 7,4,9,1,3

Lets say user array has following elements input by user at console

user: 4,2,9,7,3

Now at first iteration the digit 7 at 0-th index of lottery array is matched to the digit 4 at 0-th index of user array. This index is specified using variable i. These means the first element of lottery array is matched with first element of user array. As these digits are not equal so they don't match and the variable i is incremented to point to the position of next digit.

Now at second iteration the digit 4 in lottery array is matched to the digit 2 of user array. As these digits are not equal so they don't match and the variable i is incremented.

at third iteration the digit 9 in lottery array is matched to the digit 9 of user array. As these digits equal so they match and the variable match is incremented to 1 in order to count the number of matches. So value of match = 1

Now at fourth iteration the digit 1 in lottery array is matched to the digit 7 of user array. As these digits are not equal so they don't match and the variable i is incremented. The value of match also remains the same i.e. 1

at fifth iteration the digit 3 in lottery array is matched to the digit 3 of user array. As these digits equal so they match and the variable match is incremented to 1 in order to count the number of matches. So value of match = 2

Next the loop ends because the value of exceeds 5 which is the size of the array.

Next if(match==size) statement has an if condition which checks if all digits match. This is checked by comparing the count of match variable to the size of the array. The value of match is 2 and value of size is 5 so this means that all the digits do not match. Hence this condition evaluates to false. So the statement in if part will not execute and program moves to the statement: cout<<"Number of digits matched: "<<match<<endl; which displays the value of match variable i.e. 2 as:

Number of digits matched: 2

followed by statement cout<<"Sorry! Better luck next time!" ;  which displays the message:

Sorry! Better luck next time!

Interpersonal skills are extremely important in production management. true or false

Answers

Answer:

The statement is true. Interpersonal skills are extremely important in production management.

Explanation:

Every manager of any type of sector within a company, be it production, communications, human resources, etc., must have within their abilities those of managing interpersonal relationships with their employees and their superiors. This is so because when dealing with positions of importance within the chain of command, the constant exchange of directives, opinions and indications is necessary, with which it is very important to know how to communicate so as not to generate misunderstandings or discomfort at the time of giving such directives or indications.

Answer:

B: true

Explanation:

edg2021

Which of these is NOT a desktop computer operating system?

iOS

Linux

macOS

Windows

Answers

Answer:

IOS

Explanation:

IOS is used for mobile devices

IOS is not a desktop computer operating system. The correct option is A.

What is an operating system?

A computer's operating system is a piece of software that enables users to run other programs on the system. Almost all programs are created to operate on an operating system in order to be independent of the hardware design and are not typically intended to communicate directly with the hardware.

The main function of an operating system are:

Control the central processing unit, memory, disk drives, and printers of a computer.Create a user interface to make human-computer interaction easier.Run software programs and offer related services.

Apple Inc. conceived and developed the mobile operating system known as iOS specifically for its hardware. Many of the company's mobile devices, notably the iPhone, run on this operating system.

Therefore, IOS is a mobile operating system.

To know more about an operating system follow

https://brainly.com/question/22811693

#SPJ2

Create a datafile called superheroes.dat using any text-based editor, and enter at least three records storing superheroes’ names and main superpower. Make sure that each field in the record is separated by a space.

Answers

Answer:

Open a text-based editor like Microsoft word, notepad, libraoffice, etc, type the name of the super hero on the first field and the main power on the second field. Then click on the file menu or press ctrl-s and save file as superheroes.dat.

Explanation:

The file extension 'dat' is used to hold data for programs, for easy access. The file above holds data in fields separated by a space and has multiple records.

A file with a com extension is most likely to be a(n) ___ file.

Answers

I think that the answer is: A executable

Select one
True
False
Fin
When you insert a tall, PowerPoint assumes you want this custom background on only the current slide displayed
To make this background appear on all slides in the presentation, click the Apply to button in the Format
Background dialog box
Select one

Answers

Answer:

True

Explanation:

Which device listed below is NOT a storage device?
ROM
RAM
SSD
Removable FLASH drive

Answers

ssd is not a storage device
Answer: RAM

Explanation: RAM is the temporary memory for the motherboard. It is not used to store your favorite games, music, and documents.

10010010 + 01100010 =

The problem above is called an _________. It means that there are more ________ than can be stored in a byte, or eight bit number.

Answers

Answer:

1. binary number or 8 bit

2. bits

Explanation:

Maia wants to left align her paragraphs. Which button does she press?
o

Answers

the answer is the 2nd one because the 2nd and 4th line is moved over to the left

Answer:

It's B

Explanation:

On edge 2021

Write a program that produces a Caesar cipher of a given message string. A Caesar cipher is formed by rotating each letter of a message by a given amount. For example, if your rotate by 3, every A becomes D; every B becomes E; and so on. Toward the end of the alphabet, you wrap around: X becomes A; Y becomes B; and Z becomes C. Your program should prompt for a message and an amount by which to rotate each letter and should output the encoded message.

Answers

Answer:

Here is the JAVA program that produces Caeser cipher o given message string:

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

public class Main {  

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

       Scanner input = new Scanner(System.in);  //creates object of Scanner

       System.out.println("Enter the message : ");  //prompts user to enter a plaintext (message)

       String message = input.nextLine();  //reads the input message

       System.out.println("Enter the amount by which by which to rotate each letter : ");  //prompts user to enter value of shift to rotate each character according to shift

       int rotate = input.nextInt();  // reads the amount to rotate from user

       String encoded_m = "";  // to store the cipher text

       char letter;  // to store the character

       for(int i=0; i < message.length();i++)  {  // iterates through the message string until the length of the message string is reached

           letter = message.charAt(i);  // method charAt() returns the character at index i in a message and stores it to letter variable

           if(letter >= 'a' && letter <= 'z')  {  //if letter is between small a and z

            letter = (char) (letter + rotate);  //shift/rotate the letter

            if(letter > 'z') {  //if letter is greater than lower case z

               letter = (char) (letter+'a'-'z'-1); }  // re-rotate to starting position  

            encoded_m = encoded_m + letter;}  //compute the cipher text by adding the letter to the the encoded message

           else if(letter >= 'A' && letter <= 'Z') {  //if letter is between capital A and Z

            letter = (char) (letter + rotate);  //shift letter

            if(letter > 'Z') {  //if letter is greater than upper case Z

                letter = (char) (letter+'A'-'Z'-1);}  // re-rotate to starting position  

            encoded_m = encoded_m + letter;}  //computes encoded message

           else {  

         encoded_m = encoded_m + letter;  } }  //computes encoded message

System.out.println("Encoded message : " + encoded_m.toUpperCase());  }} //displays the cipher text (encoded message) in upper case letters

Explanation:

The program prompts the user to enter a message. This is a plaintext. Next the program prompts the user to enter an amount by which to rotate each letter. This is basically the value of shift. Next the program has a for loop that iterates through each character of the message string. At each iteration it uses charAt() which returns the character of message string at i-th index. This character is checked by if condition which checks if the character/letter is an upper or lowercase letter. Next the statement letter = (char) (letter + rotate);   is used to shift the letter up to the value of rotate and store it in letter variable. This letter is then added to the variable encoded_m. At each iteration the same procedure is repeated. After the loop breaks, the statement     System.out.println("Encoded message : " + encoded_m.toUpperCase()); displays the entire cipher text stored in encoded_m in uppercase letters on the output screen.

The logic of the program is explained here with an example in the attached document.

In this exercise we have to use the computer language knowledge in JAVA to write the code as:

the code is in the attached image.

In a more easy way we have that the code will be:

import java.util.Scanner;

public class Main {  

  public static void main(String args[]) {

      Scanner input = new Scanner(System.in);

      System.out.println("Enter the message : ");

      String message = input.nextLine();  

      System.out.println("Enter the amount by which by which to rotate each letter : ");  

      int rotate = input.nextInt();  

      String encoded_m = "";  

     char letter;  

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

          letter = message.charAt(i);

          if(letter >= 'a' && letter <= 'z')  {  

           letter = (char) (letter + rotate);  

           if(letter > 'z') {  

              letter = (char) (letter+'a'-'z'-1); }

           encoded_m = encoded_m + letter;}  

          else if(letter >= 'A' && letter <= 'Z') {

           letter = (char) (letter + rotate);  

           if(letter > 'Z') {  

               letter = (char) (letter+'A'-'Z'-1);}

           encoded_m = encoded_m + letter;}  

          else {  

        encoded_m = encoded_m + letter;  } }

System.out.println("Encoded message : " + encoded_m.toUpperCase());  }}

See more about JAVA at brainly.com/question/2266606

diagonal pliers are best for?​

Answers

They’re best for “cutting wire and small pins in areas that cannot be reached by larger cutting tools.”

Diagonal pliers are best for removing stapels

19 POINTS! What does the icon for changing the color of a cell or range look like? (Excel)


a pencil


the letter A


a paint bucket


a paintbrush

Answers

Answer:

Paintbucket

Explanation:

I got it right

Answer:

A Paint Bucket

Explanation:

Which of the following Office Online apps is most effective for creating multimedia presentations?

Answers

Answer:

Powerpoint Online

Explanation:

Powerpoint is used to create presentations.

Imagine you were using some of our pixelation tools to create an image and you posted it online for your friends to see - but, a week later you find out someone took that image and put it on a T-shirt that they’re selling for $10 each.


Now that we understand Copyright, what would need to change in order for the scenario from the warm-up to be okay?

Answers

Answer:

I will develop a CREATIVE COMMONS LICENSE

Explanation:

Based on the scenario given what i would need to change for the scenario from the warm-up to be okay is for me develop CREATIVE COMMONS LICENSE and the reason why I would develop this type of license is that it will enable people or the public to freely make use of my work or have free licence to the work that I have created by freely using it on their own products which will enables them to sell their work which have my own work on them easily and freely without any form of restrictions.

Copyright allows the creator or owner of a property (usually intellectual property) to have an absolute right over his property.

What needs to be done in this scenario is to create a creative common license.

In copyright, creative common license allows the members of the public to make use of an intellectual property for free, while the owner still retains the ownership and right, over the property.

When the creative common license is done, the seller of the T-shirt can sell the T-shirt without remitting any incentive to you; however, the seller gives you credit and recognition for the image.

Read more about copyrights at:

https://brainly.com/question/17357239

Where is the video card located in a computer?

Answers

Video card??????????
pretty sure it’s in the motherboard?

A computer processor stores numbers using a base of: _____.a) 2b) 10c) 8d) 16

Answers

It stores a base of 16

A computer processor stores numbers using a base of 16. The correct option is d).

What is a computer processor?

A computer processor is a computer processing unit that is a CPU. CPU controls all the functions of the computer. It stores memory, and it has two types of memory. Short-term and long-term. It executes all the instructions given to the computer.

The design expert discusses the project three-dimensionally at this point in the process. To define the character of the finished project and an ideal fulfillment of the project program, a variety of potential design concepts are investigated.

The different kinds of computer processors are: microprocessor, microcontroller, embedded processor, digital signal processor

Therefore, the correct option is d). 16.

To learn more about computer processors, refer to the link:

https://brainly.com/question/15102947

#SPJ5

How does the new digital image compare to the one from Challenge A? What effect did taking a larger number of samples have on the image?

Answers

Answer:

their is no image

Explanation:

Does the submission include the file "SuperPower.java"? Does the file include a public class called "SuperPower"? Does the class include a public method called "main"? Is the "main" method static? Does the main method have a String assignment statement that uses "JOptionPane.showInputDialog"? Does the main method have a statement that uses "JOptionPane.showMessageDialog"? Does the program convert the String from "JOptionPane.showInputDialog" using the "toUpperCase" method? Does the submission include a screenshot that shows an Input dialog that asks, "What is your superpower?" Does the submission include a screenshot that shows a Message dialog stating " TO THE RESCUE!", where "" is the input converted to upper case?

Answers

Answer:    

Here is the program fulfilling all the requirements given:

import javax.swing.JOptionPane;      

public class SuperPower{

public static void main(String[] args) {

String power;

power = JOptionPane.showInputDialog("What is your super power?");

power = power.toUpperCase();

JOptionPane.showMessageDialog(null, power);} }

Explanation:

Does the file include a public class called "SuperPower"

See the statement:

public class SuperPower

Does the class include a public method called "main"? Is the "main" method static?

See the statement:

public static void main(String[] args)

Does the main method have a String assignment statement that uses "JOptionPane.showInputDialog"

See the statement:

power = JOptionPane.showInputDialog("What is your super power?");

Does the main method have a statement that uses "JOptionPane.showMessageDialog"?

See the statement:

JOptionPane.showMessageDialog(null, power);

Does the program convert the String from "JOptionPane.showInputDialog" using the "toUpperCase" method?

See the statement:

power = power.toUpperCase();

Does the submission include a screenshot that shows an Input dialog that asks, "What is your superpower?" Does the submission include a screenshot that shows a Message dialog stating " TO THE RESCUE!", where "" is the input converted to upper case?

See the attached screenshots

If the program does not let you enter an exclamation mark after "to the rescue" then you can alter the code as follows:

import javax.swing.JOptionPane;

public class SuperPower{

public static void main(String[] args) {

String power;

power = JOptionPane.showInputDialog("What is your super power?");

power = power.toUpperCase();

JOptionPane.showMessageDialog( null, power+"!");} } // here just add an exclamation mark which will add ! after the string stored in  power

A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one liter of milk and the profit of each carton of milk vary from farm to farm. Write a program that prompts the user to enter: The total amount of milk produced in the morning. The cost of producing one liter of milk. The profit on each carton of milk. The program then outputs: The number of milk cartons needed to hold milk. Round your answer to the nearest integer. The cost of producing milk. The profit for producing milk.

Answers

Answer:

milk_produced = float(input("Enter the total amount of milk produced in the morning: "))

liter_cost = float(input("Enter the cost of producing one liter of milk: "))

carton_profit = float(input("Enter the profit on each carton of milk: "))

carton_needed = round(milk_produced / 3.78)

cost = milk_produced * liter_cost

profit = carton_profit * carton_needed

print("The number of milk cartons needed to hold milk is " + str(carton_needed))

print("The cost of producing milk is " + str(cost))

print("The profit for producing milk is " + str(profit))

Explanation:

*The code is in Python.

Ask the user to enter milk_produced, liter_cost and carton_profit

Calculate the number of milk cartons needed, divide the milk_produced by the capacity (3.78) of a cartoon and round the result

Calculate the cost, multiply the milk_produced by liter_cost

Calculate the profit, multiply the carton_profit by carton_needed

Print the results

What code would you use to tell if "schwifty" is of type String?
a. "schwifty".getClass().getSimpleName() == "String"
"b. schwifty".getType().equals("String")
c. "schwifty".getType() == String
d. "schwifty" instanceof String

Answers

Answer:

d. "schwifty" instanceof String

Explanation:

Given

List of options

Required

Determine which answers the question.

The syntax to check an object type in Java is:

[variable/value] instanceof [variable-type]

Comparing this syntax to the list of options;

Option d. "schwifty" instanceof String matches the syntax

Hence;

Option d answers the question

Write a program that prompts the user to input an integer that represents the money in cents. The program will the calculate the smallest combination of coins that the user has. For example, 42 cents is 1 quarter, 1 dime, 1 nickel, and 2 pennies. Similarly, 49 cents is 1 quarter, 2 dimes, and 4 pennies

Answers

Answer:

The program in Python is as follows:

cents = int(input("Cent: "))

quarter = int(cents/25)

if quarter > 1:

     print(str(quarter)+" quarters")

elif quarter == 1:

     print(str(quarter)+" quarter")

cents = cents - quarter * 25

dime = int(cents/10)

if dime>1:

     print(str(dime)+" dimes")

elif dime == 1:

     print(str(dime)+" dime")

cents = cents - dime * 10

nickel = int(cents/5)

if nickel > 1:

     print(str(nickel)+" nickels")

elif nickel == 1:

     print(str(nickel)+" nickel")

penny = cents - nickel * 5

if penny > 1:

     print(str(penny)+" pennies")

elif penny == 1:

     print(str(penny)+" penny")

Explanation:

This line prompts user for input in cents

cents = int(input("Cent: "))

This line calculates the number of quarters in the input amount

quarter = int(cents/25)

This following if statement prints the calculated quarters

if quarter > 1:

     print(str(quarter)+" quarters")

elif quarter == 1:

     print(str(quarter)+" quarter")

cents = cents - quarter * 25

This line calculates the number of dime in the input amount

dime = int(cents/10)

This following if statement prints the calculated dime

if dime>1:

     print(str(dime)+" dimes")

elif dime == 1:

     print(str(dime)+" dime")

cents = cents - dime * 10

This line calculates the number of nickels in the input amount

nickel = int(cents/5)

This following if statement prints the calculated nickels

if nickel > 1:

     print(str(nickel)+" nickels")

elif nickel == 1:

     print(str(nickel)+" nickel")

This line calculates the number of pennies in the input amount

penny = cents - nickel * 5

This following if statement prints the calculated pennies

if penny > 1:

     print(str(penny)+" pennies")

elif penny == 1:

     print(str(penny)+" penny")

Other Questions
5t+1= 9Please help me Which answers accurately describe the growth of African populations in America?es - 1A)The first shipment of Africans arrived in Virginia.B)c)New York was founded using the plantation system for agriculturalproductionAs African slave population increased, colonists put stricter codes tocontrol them.Between 1450-1870, historians estimated the population growth to bearound one to two million.African population grew extremely fast initially, but later slowed downafter the British chartered the Royal African Company.D)E what is torque...........m Scott got $20.00 after finishing his chores for the week. He bought a chocolate bar for $1.79 and a bag of Takis for $1.99. What was the total amount of money he spent? Is 8.15 a natural number whole number integer rational irrational or real number ? Instructions Currently, this program will add 6 and 3 together, output the math problem and output the answer. Edit this code so that a random number is generated from 1 - 10 (inclusive) for the variables a and b. Also, instead of adding the two numbers together, the edited program should multiply them, and output the proper math problem and answer. Be sure to update every line of code to reflect the changes needed. import random What is a resting heart rate and how can it be used to evaluate the progress of a fitness program? 5(-42/-7) + (-15) - (-3) On a coordinate plane, 2 lines are shown. Line P Q has points (negative 5, 3) and (5, 1). Line R S has points (negative 4, negative 2) and (0, negative 4). Which statement best explains the relationship between lines PQ and RS? They are parallel because their slopes are equal. They are parallel because their slopes are negative reciprocals. They are not parallel because their slopes are not equal. They are not parallel because their slopes are negative reciprocals. A scientist performs an investigation and discovers that increased temperature decreases the number of offspring that an organism produces. Then, the scientist asks a new question about the impact of climate change on the species because HELP!!!An arrow is shot into the air at an angle of 30.0 above the horizontal with a speed of 20.0 m/s. What are the x and y components of thevelocity of the arrow 1.0 s after it leaves the bowstring? please help, thanks! Meningitis is a disease that is characterized by swelling of the meninges that puts pressure on the brain. Which isleast likely to be a symptom of this disease?severe headacheO swollen anklessensitivity to lightO confusion According to the observations that Washington Matthews made of Navajo songs, which of the following reasons is most likely the purpose of "Twelfth Song of Thunder"? to ask the gods for wealth and material items to heal the sick people within the community to welcome visitors and travelers to ask for a gift such as rain, from nature Metric mania How many shoes would it take to make 1 kilometer I am so dumb i can't understand geometry Convert 42.4 inches to meters.Round your answer to 2 decimal points Individuals make decisions about what things to produce A: traditional economy B: market economy C: command economy D:mixed economy What is the inside of an atom mostly made of?Select one:1a. electricityb. empty spacec. particles I need help please helpp