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
snow_lady [41]
2 years ago
13

2) Please create a C program for the following: (25 points) a. Suppose the US dollar to Korean Won is 0.85 dollars to 1000 won.

Ask the user how many won is currently within their wallet / purse. Print out how much the Won is worth in US dollars, Indian Rupee (0.014 to the dollar), Jordanian Dinar (1.41 to the dollar) and Mexican Peso (0.048 to the dollar). You may also add another country of your choosing.
Computers and Technology
1 answer:
Zanzabum2 years ago
3 0

Answer:

In C:

#include <stdio.h>

int main(){

       float won,usd,rupee,dinar,peso;

       printf("Won: ");

       scanf("%f", &won);

       usd = won * 0.85/1000;

       rupee = won * 0.85 * 0.14/1000;

       dinar = won * 0.85 * 0.048/1000;

       peso = won * 0.85 * 1.41/1000;

       printf("USD = %f\n", usd);

       printf("Rupee = %f\n", rupee);

       printf("Dinar = %f\n", dinar);

       printf("Peso = %f\n", peso);

   return 0;

}

Explanation:

This declares all variables as float

float won,usd,rupee,dinar,peso;

This prompts the user for Korean Won

       printf("Won: ");

This gets the input for won

       scanf("%f", &won);

This converts to usd

       usd = won * 0.85/1000;

This converts to rupee

       rupee = won * 0.85 * 0.14/1000;

This converts to dinar

       dinar = won * 0.85 * 0.048/1000;

This converts to peso

       peso = won * 0.85 * 1.41/1000;

The next four lines print the converted currencies

       printf("USD = %f\n", usd);

       printf("Rupee = %f\n", rupee);

       printf("Dinar = %f\n", dinar);

       printf("Peso = %f\n", peso);

You might be interested in
The Yuba College Library would like a program to calculate patron fines for overdue books. Fines are determined as follows: Pape
mestny [16]

Answer:

Explanation:

The following Python code creates all of the necessary functions in order to request and validate all of the inputs from the user. Once everything is entered and validated it calculates the total fee and outputs it to the user. Also calls the entire class at the end using a test variable...

class Customer:

   library_card = 0

   patrons_name = ""

   patrons_address = ""

   type_of_book = ""

   book_title = ""

   days_overdue = 0

   fee = 0.0

   book_list = ['paperback regular', 'paperback best seller', 'magazine', 'hardcover']

   def __init__(self):

       self.library_card = self.get_library_card()

       self.patrons_address = input("Patron's Address: ")

       self.book_title = input("Book Title: ")

       self.type_of_book = self.get_type_of_book()

       self.days_overdue = float(self.get_days_overdue())

       self.calculate_total()

       print("Your total Fee is: " + str(self.fee))

   def get_library_card(self):

       library_card = int(input("Enter 4-digit library card number: "))

       if (type(library_card) == type(0)) and (len(str(library_card)) == 4):

           return library_card

       else:

           print("Invalid Card number:")

           self.get_library_card()

   def get_type_of_book(self):

       type_of_book = input("Type of Book 1-4: ")

       if (int(type_of_book) > 0) and (int(type_of_book) <= 4):

           return int(type_of_book)

       else:

           print("Invalid Type")

           self.get_type_of_book()

   def get_days_overdue(self):

       days_overdue = input("Number of Days Overdue: ")

       if int(days_overdue) >= 0:

           return days_overdue

       else:

           print("Invalid number of days")

           self.get_days_overdue()

   def calculate_total(self):

       if self.type_of_book == 1:

           self.fee = 0.20 * self.days_overdue

           if self.fee > 8:

               self.fee = 8

       elif self.type_of_book == 2:

           self.fee = 0.50 * self.days_overdue

           if self.fee > 15:

               self.fee = 15

       elif self.type_of_book == 3:

           self.fee = 0.25 * self.days_overdue

           if self.fee > 5:

               self.fee = 5

       else:

           self.fee = 0.30 * self.days_overdue

           if self.fee > 23:

               self.fee = 23

test = Customer()

5 0
2 years ago
Anyone know what this is pls help
andreyandreev [35.5K]

Answer:

Grass

Explanation:

When the wind blows grass or small plants start dancing (?)

<em>#</em><em>S</em><em>p</em><em>r</em><em>e</em><em>a</em><em>d</em><em>T</em><em>h</em><em>e</em><em>K</em><em>n</em><em>o</em><em>w</em><em>l</em><em>e</em><em>d</em><em>g</em><em>e</em>

4 0
2 years ago
Write a program that reads in characters from standard input and outputs the number of times it sees an 'a' followed by the lett
Simora [160]

Answer:

Following is attached the code that works accordingly as required. It reads in characters from standard input and outputs the number of times it sees an 'a' followed by the letter 'b'. All the description of program is given inside the code as comments.

I hope it will help you!

Explanation:

6 0
3 years ago
Java and Python are considered rapid development programming languages?<br><br> True<br><br> False
Zepler [3.9K]
That is true because Java was considered a rapid development programming language
8 0
3 years ago
Read 2 more answers
One of the disadvantages of Photoshop Express is that it does not have a Black and White effect. True False
Katarina [22]
False,
The Pop Color tool can be used to select one particular color, changing the rest of the image to black and white. The effects available in Photoshop Express don't allow for a huge amount of customization
8 0
3 years ago
Other questions:
  • You are to create a program using Python that asks the user for a nonnegative number, then computes the mean and variance using
    15·1 answer
  • When it comes to safety, the choice to be safe is often up to __________?
    8·1 answer
  • Find the area of the regular hexagon below by using the area formula for triangles.
    7·1 answer
  • Assign a variable solveEquation with a function expression that has three parameters (x, y, and z) and returns the result of eva
    6·1 answer
  • The architecture that the large paper company Mohawk adopted enables the company to scale technology services up and down instan
    14·1 answer
  • When you need to cut new external threads on a bolt, which of the following tools should you use?
    9·2 answers
  • Which model represents any process in general?
    6·1 answer
  • You have been hired by a small company to install a backbone to connect four 100base-T Ethernet LANs (each using one 24-port hub
    12·1 answer
  • Describe your WGU program, including two specific requirements that this degree has for completion.
    14·1 answer
  • Mention 3 components that can be found at the back and front of the system unit​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!