Write a program that gets three input characters which are user's initials and displays them in a welcoming message. Then gets input of the quantities of each of the following coins, in the respective order, quarters, dimes, nickels, and pennies.
Computes the total value of the coins, and then displays the value.
Enter the initials with no space, e.g. JTK.
Here are sample runs (blue user input):
Test Run 1
Enter your initials, first, middle and last: JTK Hello J.T.K., let's see what your coins are worth.
Enter number of quarters: 4
Enter number of dimes: 0
Enter number of nickels: 0
Enter number of pennies: 0
Number of quarters is 4.
Number of dimes is 0.
Number of nickels is 0.
Number of pennies is 0.
Your coins are worth 1 dollars and 0 cents.
Test Run 2 Enter your initials, first, middle and last: RHT
Hello R.H.T., let's see what your coins are worth.
Enter number of quarters: 0
Enter number of dimes: 10
Enter number of nickels: 0
Enter number of pennies: 0
Number of quarters is 0.
Number of dimes is 10.
Number of nickels is 0.
Number of pennies is 0.
Your coins are worth 1 dollars and 0 cents.

Answers

Answer 1

Answer:

#include <iostream>

using namespace std;

int main()

{

// variable declaration

string initials;

int quarters;

int dimes;

int nickels;

int pennies;

float total;

int dollars;

int cents;

 

 

//initials request

std::cout<<"Enter your initials, first, middle and last: "; std::cin>>initials;

//welcome message

std::cout<<"\nHello "<<initials<<"., let's see what your coins are worth."<<::std::endl;

 

//coins request and display

std::cout<<"\nEnter number of quarters: "; std::cin>>quarters;

std::cout<<"\nEnter number of dimes: "; std::cin>>dimes;

std::cout<<"\nEnter number of nickels: "; std::cin>>nickels;

std::cout<<"\nEnter number of pennies: "; std::cin>>pennies;

 

std::cout<<"\n\nNumber of quarters is "<<quarters;

std::cout<<"\nNumber of dimes is "<<dimes;

std::cout<<"\nNumber of nickels is "<<nickels;

std::cout<<"\nNumber of pennies is "<<pennies;

//total value calculation

total = quarters*0.25+dimes*0.1+nickels*0.05+pennies*0.01;

dollars = (int) total;

cents = (total-dollars)*100;

 

std::cout<<"\n\nYour coins are worth "<<dollars<<" dollars and "<<cents<<" cents."<<::std::endl;

 

return 0;

}

Explanation:

Code is written in C++ language.

First we declare the variables to be used for user input and calculations.Then we show a text on screen requesting the user to input his/her initials, and displaying a welcome message.The third section successively request the user to input the number of quarters, dimes, nickels and pennies to count.Finally the program calculates the total value, by giving each type of coin its corresponding value (0.25 for quarters, 0.1 for dimes, 0.05 for nickels and 0.01 for pennies) and multiplying for the number of each coin.To split the total value into dollars and cents, the program takes the total variable (of type float) and stores it into the dollars variable (of type int) since int does not store decimals, it only stores the integer part.Once the dollar value is obtained, it is subtracted from the total value, leaving only the cents part.

   


Related Questions

what do the three dots : . seen in equations/proof mean

Answers

the three dots usually means “therefore”

Pls help will mark brainliest as soon as u awnser

Answers

Answer:

The answer is...

Explanation:

It is A or D I would go with D tho

Hope this helped

:)

Pls awnser I will mark brainliest as soon as possible

Answers

what are the multiple choice answers?

Answer:

Andriod

Explanation:

CH4 has how many of each type of atom?

Answers

Its easy that moderators that see this answer can think that my answer isn't without explanation.

• Type of atom C (Carbon)

C = 1

• Type of atom H (Hydrogen)

H = 4

You dont understand? JUST SEE THE FORMULA C MEANS ONLY HAVE 1 CARBON ATOM AND H4 MEANS 4 ATOM OF HYDROGEN

oK. have a nice day hope you understands

What is the function for displaying differences between two or more scenarios side by side?
Macros
Merge
Scenario Manager
Scenario Summary

Answers

Answer:

its d

Explanation:

Answer:

scenario summary

Explanation:

In this exercise we will practice using loops to handle collections/containers. Your job is to write a program that asks the user to enter a sentence, then it counts and displays the occurrence of each letter.
Note: your program should count the letters without regard to case. For example, A and a are counted as the same.
Here is a sample run:
Enter a sentence: It's a very nice day today!
a: 3 times
c: 1 times
d: 2 times
e: 2 times
i: 2 times
n: 1 times
o: 1 times
r: 1 times
s: 1 times
t: 2 times
v: 1 times
y: 3 times
Notes:
The purpose of this problem is to practice using loops and collections/containers/strings.
Please make sure to submit a well-written program. Good identifier names, useful comments, and spacing will be some of the criteria that will be used when grading this assignment.
This assignment can be and must be solved using only the materials that have been discussed in class: loops, the index system, strings, lists and/or dictionaries. Do not look for or use alternative methods that have not been covered as part of this course.
How your program will be graded:
correctness: the program performs calculations correctly: 40%
complies with requirements (it properly uses loops, and containers/strings): 40%
code style: good variable names, comments, proper indentation and spacing : 20%
Language is python 3

Answers

Answer:

In Python:

chars = 'abcdefghijklmnopqrstuvwxyz'

letter = input("Sentence: ")

for i in range(len(chars)):

   count = 0

   for j in range(len(letter)):

       if chars[i] == letter[j].lower():

           count = count + 1

   if count > 0 :

       print(chars[i]+": "+str(count)+" times")

Explanation:

This initializes the characters of alphabet from a-z

chars = 'abcdefghijklmnopqrstuvwxyz'

This prompts the user for sentence

letter = input("Sentence: ")

This iterates through the initialized characters

for i in range(len(chars)):

This initializes count to 0

   count = 0

This iterates through the input sentence

   for j in range(len(letter)):

This compares the characters of the sentence with alphabet a-z

       if chars[i] == letter[j].lower():

If there is a match, count is incremented by 1

           count = count + 1

If there is an occurrence of character,

   if count > 0 :

The character and its count is printed

       print(chars[i]+": "+str(count)+" times")

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.

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

chars = 'abcdefghijklmnopqrstuvwxyz'

letter = input("Sentence: ")

for i in range(len(chars)):

  count = 0

  for j in range(len(letter)):

      if chars[i] == letter[j].lower():

          count = count + 1

  if count > 0 :

      print(chars[i]+": "+str(count)+" times")

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

Pls help I will give points

Answers

Answer:

phone !!

Explanation:

since it's a mobile app, that would apply to a handheld device !!

i hope this helps !!

Answer:

any answer except a desktop or laptop, i.e. tablets, phones, pda's, etc.

Explanation:

Mobile apps are designed for handheld mobile devices, even though laptops are technically mobile, they're based upon desktop computer arcitechture, in which mobile apps will not run, I hope this helps.

Someone please help ASAP will brainlist

Answers

I think it’s audio mixer panel

Write a python 3 function named words_in_both that takes two strings as parameters and returns a set of only those words that appear in both strings. You can assume all characters are letters or spaces. Capitalization shouldn't matter: "to", "To", "tO", and "TO" should all count as the same word. The words in the set should be all lower-case. For example, if one string contains "To", and the other string contains "TO", then the set should contain "to".
1.Use python's set intersection operator in your code.
2.Use Python's split() function, which breaks up a string into a list of strings. For example:

sentence = 'Not the comfy chair!'
print(sentence.split())
['Not', 'the', 'comfy', 'chair!']
Here's one simple example of how words_in_both() might be used:

common_words = words_in_both("She is a jack of all trades", 'Jack was tallest of all')

Answers

Answer:

def words_in_both(a, b):

 a1 = set(a.lower().split())

 b1 = set(b.lower().split())

 return a1.intersection(b1)

common_words = words_in_both("She is a jack of all trades", 'Jack was tallest of all')

print(common_words)

Explanation:

Output:

{'all', 'of', 'jack'}

The program returns the words which exists in both string parameters passed into the function. The program is written in python 3 thus :

def words_in_both(a, b):

#initialize a function which takes in 2 parameters

a1 = set(a.lower().split())

#split the stings based on white spaces and convert to lower case

b1 = set(b.lower().split())

return a1.intersection(b1)

#using the intersection function, take strings common to both variables

common_words = words_in_both("She is a jack of all trades", 'Jack was tallest of all')

print(common_words)

A sample run of the program is given thus :

Learn more : https://brainly.com/question/21740226

Why were low quality video so often use when Internet connection we’re poorer than they are today

Answers

What do you mean? I’m confused with the question, it doesn’t make sense:)

Answer:

The answer is C. "High-quality videos took too long to transfer" in Fundamentals of Digital Media.

(Please Help! Timed Quiz!) Messages that have been accessed or viewed in the Reading pane are automatically marked in Outlook and the message subject is no longer in bold. How does a user go about marking the subject in bold again?

*Mark as Read
*Flag the Item for follow-up
*Assign a Category
*Mark as Unread

Answers

Answer:

D Mark as Unread

Explanation:

I just took the test

what is volitile memory?

Answers

Answer:

do you mean volatile? Volatile memory is a type of storage whose contents are erased when the system's power is turned off or interrupted.

Explanation:

hope this helps have a good rest of your day :) ❤

Juan is writing a new program using Python and wants to make sure each step is located on its own line. Which principal of programming is Juan following?

Hand coding
Line coding
Planning & Design
Sequencing
PLEASE HURRYYY THIS IS A FINAL EXAM :C

Answers

Answer:

Its sequencing or planning and design not 100%

Explanation:

Answer:

its sequencing

Explanation:

A switch on a circuit board can be in two states what are they​

Answers

Answer:

on and off

Explanation:

1. Write a class Name that stores a person’s first, middle, and last names and provides the following methods:
public Name(String first, String middle, String last)—constructor. The name should be stored in the case given; don’t convert to all upper or lower case.
public String getFirst()—returns the first name
public String getMiddle()—returns the middle name
public String getLast()—returns the last name
public String firstMiddleLast()—returns a string containing the person’s full name in order, e.g., "Mary Jane Smith".
public String lastFirstMiddle()—returns a string containing the person’s full name with the last name first followed by a comma, e.g., "Smith, Mary Jane".
public boolean equals(Name otherName)—returns true if this name is the same as otherName. Comparisons should not be case sensitive. (Hint: There is a String method equalsIgnoreCase that is just like the String method equals except it does not consider case in doing its comparison.)
public String initials()—returns the person’s initials (a 3-character string). The initials should be all in upper case, regardless of what case the name was entered in. (Hint: Instead of using charAt, use the substring method of String to get a string containing only the first letter—then you can upcase this one-letter string. See Figure 3.1 in the text for a description of the substring method.)
public int length()—returns the total number of characters in the full name, not including spaces.
2. Now write a program TestNames.java that prompts for and reads in two names from the user (you’ll need first, middle, and last for each), creates a Name object for each, and uses the methods of the Name class to do the following:
a. For each name, print
first-middle-last version
last-first-middle version
initials
length
b. Tell whether or not the names are the same.
Here is my code. I keep getting a method error with getFullName in the Name.java file. Please help me re-write the code to fix this issue.
//Name.java
public class Name
{
private String firstName, middleName, lastName, fullName;
public Name(String first, String middle, String last)
{
firstName = first;
middleName = middle;
lastName = last;
String fullName = firstName '+' middleName '+' lastName;
}
public String getFirst()
{
return firstName;
}
public String getMiddle()
{
return middleName;
}
public String getLast()
{
return lastName;
}
public String firstMiddleLast()
{
return firstName + ' ' + middleName + ' ' + lastName;
}
public String lastFirstMiddle()
{
return lastName + ", " + firstName + ' ' + middleName;
}
public boolean equals(Name otherName)
{
return fullName.equalsIgnoreCase(otherName.getFullName());
}
public String initials()
{
return firstName.toUpperCase().substring(0,1)
+ middleName.toUpperCase().substring(0,1)
+ lastName.toUpperCase().substring(0,1);
}
public int length()
{
return firstName.length() + middleName.length() + lastName.length();
}
}
//NameTester.java
import java.util.Scanner;
public class NameTester
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String firstName1 = new String();
String middleName1 = new String();
String lastName1 = new String();
String firstName2 = new String();
String middleName2 = new String();
String lastName2 = new String();
System.out.print("\nPlease enter a first name: ");
firstName1 = input.nextLine();
System.out.print("Please enter a middle name: ");
middleName1 = input.nextLine();
System.out.print("Please enter a last name: ");
lastName1 = input.nextLine();
Name name1 = new Name(firstName1, middleName1, lastName1);
System.out.print("\nPlease enter another first name: ");
firstName2 = input.nextLine();
System.out.print("Please enter another middle name: ");
middleName2 = input.nextLine();
System.out.print("Please enter another last name: ");
lastName2 = input.nextLine();
Name name2 = new Name(firstName2, middleName2, lastName2);
System.out.println();
System.out.println(name1.firstMiddleLast());
System.out.println(name2.firstMiddleLast());
System.out.println(name1.lastFirstMiddle());
System.out.println(name2.lastFirstMiddle());
System.out.println(name1.initials());
System.out.println(name2.initials());
System.out.println(name1.length());
System.out.println(name2.length());
if (name1.equals(name2))
System.out.println("The names are the same.");
else
System.out.println("The names are not the same.");
}
}

Answers

i dont know the answer lol thats too long

Explanation:

What is the only language that a computer can understand

Answers

Answer: Low-Level language is the only language which can be understood by the computer. Low-level language is also known as Machine Language. The machine language contains only two symbols 1 & 0. All the instructions of machine language are written in the form of binary numbers 1's & 0's.

Explanation:

Answer:

Machine Language (low level language)

Low-Level language is the only language which can be understood by the computer. Low-level language is also known as Machine Language. The machine language contains only two symbols 1 & 0. All the instructions of machine language are written in the form of binary numbers 1's & 0's.

what are the pros and Con's of human -computer interaction?​

Answers

Answer:

pros-you can talk to a man made intelligence without the drama except for system crashes lol

-you can have them as a romantic partner.

cons-there are programmed emotions so it isn’t that real.

romantic emotion can be fake.

Explanation:

In the computing environment the numerical value represented by the pre-fixes kilo-, mega-, giga-, and so on can vary depending on whether they are describing bytes of main memory or bits of data transmission speed. Research the actual value (the number of bytes) in a Megabyte (MB) and then compare that value to the number of bits in a Megabit (Mb). Are they the same or different

Answers

Answer:

1024 bytes in a megabyte and there are 8000000 bits in a megabyte. They are different.

Explanation:

There are 8000000 bits and 1024 bytes in one megabyte. They are unique.

What is Megabyte?

The megabyte is a multiple of the digital informational unit byte. The suggested unit sign for it is MB. The International System of Units unit prefix mega is a multiplier of 1000,000. As a result, one megabyte is equal to one million bytes of data.

About a million bytes make up a megabyte (or about 1000 kilobytes). Typically, a few megabytes might be required for a 10-megapixel digital camera photograph or a brief MP3 music clip.

1000000 bytes make up one megabyte (decimal). In base 10, 1 MB equals 106 B. (SI). 1048576 bytes make up a megabyte (binary). A megabyte can imply either 1,000,000 bytes or 1,048,576 bytes, according to the Microsoft Press Computer Dictionary. Apparently, Eric S.

To read more about Megabyte, refer to - https://brainly.com/question/2575232

#SPJ2

ANSWER QUICK 50 POINTS
You have the following code in your program.

from array import *
Which line of code would create an array?


D = array([2.5, 3, 7.4])

D = array('f',[2.5, 3, 7.4])

D = array['f',[2.5, 3, 7.4]]

D = array('f',2.5, 3, 7.4)

Answers

Answer:

D = array('f',[2.5, 3, 7.4])

Explanation:

is the answer

A variable must be declared with an array type before the array itself can be created. Array types resemble other Java types, with the exception that square brackets are placed after them ( [] ). Thus, option D is correct.

What line of code would create an array?

Using the NumPy library, new data types known as arrays can be produced in Python. NumPy arrays are created for numerical studies and only contain one data type.To build an array, use the array() method after importing NumPy. The input for the array() function is a list.

An array, also known as a database system, is a group of things or data that is held in a contiguous memory area in coding and programming. Several instances of the same kind of data are grouped together in an array.

Therefore, D = array('f',2.5, 3, 7.4)  line of code would create an array.

Learn more about array here:

https://brainly.com/question/22296007

#SPJ2

In a program, write a method that accepts two arguments: an array of integers and a number n. The method should print all of the numbers in the array that are greater than the number n (in the order that they appear in the array, each on their own line).
In the same file, create a main method and call your function using the following data sets:
The array {1, 5, 10, 2, 4, -3, 6} and the number 3.
The array {10, 12, 15, 24} and the number 12.
My code:
public class LargerThanN
{
public static void print(int[] array,int n)
{
for(int i=0; i {
if (array[i]>n)
System.out.println(array[i]);
}
System.out.println();
}
public static void main(String[] args)
{
int[] array1 = {1,5,10,2,4,-3,6};
int num1=3;
print(array1,num1);
int[] array2 = {10, 12, 15, 24};
int num2 = 12;
print(array2, num2);
}
}
My programming lab does not want extra lines between the output. What am I doing wrong? How do I fix it?

Failed Test Run
The contents of your standard output is incorrect.
Attention: the difference between your stdout and the expected stdout is just a question of spacing.
Standard Output Hide Invisibles
Your Code's Actual Result:
Expected Result: 5
5 10
10 4
4 6
6
15 15
24 24

Answers

Answer:

move the System.out.println(); outside the for loop.

Explanation:

see picture. I shortened the main() method a bit, for fun.

use a for loop to create a random forest model for each value of n estimators from 1 to 30;
• evaluate each model on both the training and validation sets using MAE;
• visualize the results by creating a plot of n estimators vs MAE for both the training and validation sets
After that you should answer the following questions:
• Which value of n estimators gives the best results?
• Explain how you decided that this value for n estimators gave the best results:
Why is the plot you created above not smooth?
• Was the result here better than the result of Part 1? Wha: % better or worse was it? in python

Answers

Answer:

nvndknnnnnnngjf

Explanation:

f4tyt5erfhhfr

what is the purpose of a head tag

Answers

to contain specific information about a web page, often referred to as metadata. This information includes things like the title of the document (which is mandatory), scripts or links to scripts, and CSS files.

Answer:

Explanation: I don't know English very well but  I will try to explain to you. We need head tag in HTML -> for enter the title of the page, add extra meta data, put a picture title bar of the document and connect with another document

the internet is a network of only ten thousands computers true or false

With saying why true or why false

Thanks ​

Answers

Answer: False

Reason: There's a lot more then 10 thousand computers on the internet.

40 POINTS help please

Answers

Answer:

Explanation:

nice dave

Pls help I will get points and brainliest

Answers

Answer:

They are both types of interfaces.

Explanation:

Click the answer that includes the word "Interface" or "Interfaces"

Find the unknown quantities

Answers

Answer:

I = 11/2 = 5.5

R = 60/11 ≈ 5.5Ω

Explanation:

You use V = I·R twice.

Entire circuit: 140 = I·(20+R)

Resistor: 30 = I·R

Solving this system of equations gives:

140 = I·(20+R) = 20I + IR

30 = I·R

140 = 20I + 30

20I = 110

I = 11/2 = 5.5

R = 60/11 ≈ 5.5Ω

Write a program that calculates the area & perimeter of a rectangle, where
the values for width and length are given by the users.

Answers

Answer:

In Python:

Length = float(input("Length: "))

Width = float(input("Width: "))

Area = Length * Width

Perimeter = 2*(Length + Width)

print(Area)

print(Perimeter)

Explanation:

This gets the length from the user

Length = float(input("Length: "))

This gets the width from the user

Width = float(input("Width: "))

This calculates the area

Area = Length * Width

This calculates the perimeter

Perimeter = 2*(Length + Width)

This prints the area

print(Area)

This prints the perimeter

print(Perimeter)

Which of the following make up atoms? A. weight, mass, and gravity B. protons, electrons, and neutrons C. elements, compounds, and molecules D. matter, non-matter, and air pressure

Answers

Answer:

B

Explanation:

protons, electrons and neutrons

Which of the following statements demonstrates the consequence of segregated medical
care?
A. Inequitable access to education and funding for Black doctors
B. Fewer predominately white medical schools being open to Black students
C. Both A and B
D. Neither A nor B

Answers

Answer:

C. Both A and B

Explanation:

Not only is inequitable access to education and funding for Black doctors a consequence of segregated medical care, it also resulted in less predominately white medical schools allowing Black students.

The statements that demonstrate the consequence of segregated medical care are both statements A and B. The correct option is C.

What is segregated medical care?

To distinguish or put apart from others or the general population. Segregated medical care has led to Black students being accepted into less primarily white medical institutions, which has resulted in unequal access to education and funding for Black professionals.

Black doctors have unequal access to education and funding. Less predominantly white medical colleges accept students of color.

Medical discrimination, racialized socioeconomic deprivation, and a segregated healthcare system all contribute to drastically different experiences in care for Black and White patients.

Therefore, the correct option is C. Both A and B.

To learn more about segregated medical care, refer to the link:

https://brainly.com/question/10812745

#SPJ6

During early recording, microphones picked up sound waves and turned them into electrical signals that carved a _______ into the vinyl. (6 letters)

WILL PICK YOU AS BRAINLIEST!


hint- NOT journalism

HURRY please

Answers

Answer:

Groove

Explanation:

There is not much to explain

Other Questions
The table shows which mRNA codons code for various amino acids.Which amino acid sequence will be produced by translation of the mRNAsequence UAC UCU ACC? PLEASE help. Been grounded for a month for late work, this is my last assignment I have and can't do it.Please write a script IN SPANISH for a commercial following these guidelines/requirements:Preparen un comercial de televisin donde invitan a su comunidad a visitar su nuevo negocio. Incluyan: el vocabulario (en la ciudad, en el correo, en el banco, cmo llegar, etc.) el subjuntivo en clusulas adjetivas los mandatos de nosotros/as los participios pasados usados como adjetivos _____________are opposite angles that share the same vertex. They are formed by a pair of intersecting lines. Their angle measures are equal. Please guys please! I need help ASAP! (Giving brainliest)! Summer sets up a lemonade stand in order to earn some extra money at noon she has sold $15 worth of lemonade she is selling lemonade for $0.75 per cup if she sells 50 more cups of Lemonade by the other day how much money will she have made How can we use poetry to advocate for social justice? Which of these values for the number of feet in a mile is most accurate, whencompared to the exact value?A. 5,200B. 5,290C. 5,000D. 5,300 The ratio of the height of a skateboard ramp to the length of the skateboard ramp is 1 to 3.The height of the ramp is 15 feet.What is the length of the ramp Which expression is equal to find the polynomial function of degree 3 whose y intercepts is 2 and x is 2 and 3 1) Which is the slope in the following linear equation?y= 7x + 3A. 3B. 11C. 7D. 4 150 adult complete a survey 80 are women write the ratio men: women in it's simplest form. what is the main problem with this introduction paragraph? Can someone please please please help me on this(Number 1 and 2 is in the picture) 3. F(x) = 2^x between x = 1 and x = 34. F(x) = 3^x. [1,2] Which quote from Washingtons speech best supports the answer to part A Which statement best describes how the US Constitution affects the separation of powers in the federalgovernment? What is the central idea regarding the Harlem Renaissance 17) Find DE3r - 283r - 30xDG33help asapp !!! Wade Company estimates that it will produce 6,800 units of product IOA during the current month. Budgeted variable manufacturing costs per unit are direct materials $8, direct labor $13, and overhead $17. Monthly budgeted fixed manufacturing overhead costs are $8,300 for depreciation and $3,500 for supervision. In the current month, Wade actually produced 7,300 units and incurred the following costs: direct materials $51,800, direct labor $87,400, variable overhead $124,400, depreciation $8,300, and supervision $3,780.Prepare a static budget report. Hint: The Budget column is based on estimated production while the Actual column is the actual cost incurred during the period. (List variable costs before fixed costs.) Wade Company Static Budget Report Difference Favorable Neither Favorable Budget Actual nor Unfavorable Were costs controlled? Nico is brainstorming reasons to support this claim for his argumentative essay.Bob Dylan deserved to win the Nobel Prize.