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]
3 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:
Zanzabum3 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
Which of the following class definition defines a legal abstract class Group of answer choices public class Rectangle abstract {
valkas [14]
<h2>Question</h2>

Which of the following class definition defines a legal abstract class Group of answer choices

(a)

public class Rectangle abstract {

   public abstract double findArea ( );

   

}

(b)

public abstract class Rectangle {

   public abstract double findArea ( );

   

}

(c)

public class Rectangle {

   public abstract double findArea ( );

   

}

(d)

public class abstract Rectangle {

   public abstract double findArea ( );

   

}

<h2>Answer:</h2>

(b)

public abstract class Rectangle {

   public abstract double findArea ( );

}

<h2>Explanation:</h2>

When a class is declared with the abstract keyword, the class is called an abstract class. Abstract classes cannot be instantiated and may include one or more abstract methods. If a class contains an abstract method, then it (the class) must be declared abstract.

In Java, abstract classes are defined using the following format:

<em>[access_modifier]</em> abstract class <em>[name_of_class]</em>

[access_modifier] specifies the access modifier of the class which could be public, private, e.t.c

abstract is the keyword that specifies that the class is an abstract class.

class is a keyword used for defining classes

name_of_class specifies the name of the class.

The only option that fulfils this format is <em>option b</em> where;

(i) The access modifier is public

(ii) The name of the class is Rectangle

Option a is not correct because the <em>abstract</em> keyword is supposed to come before the <em>class</em> keyword.

Option c is not correct because the keyword <em>abstract</em> is missing. In other words, the class must be declared abstract since it contains abstract method findArea();

Option d is not correct because the <em>abstract</em> keyword is supposed to come before the <em>class</em> keyword.

7 0
3 years ago
Is this really a American Server ???
zloy xaker [14]

Explanation:

I am from Nepal and i don't know about this topic.

6 0
3 years ago
Anomaly detection systems make use of _______________ that describe the services and resources each authorized user or group nor
zhuklara [117]

Answer:

profiles

Explanation:

<h2><u>Fill in the blanks </u></h2>

Anomaly detection systems make use of <u> profiles</u> that describe the services and resources each authorized user or group normally accesses on the network.

5 0
3 years ago
Consider the following scenario. As you troubleshoot the problem, what motherboard device would be the first to
prohojiy [21]
Check if the board is getting power, if it isn’t, than you may have a power supply issue.
8 0
3 years ago
Let S be an NP-complete problem and Q and R be two other problems not known to be in NP. Q is polynomial time reducible to S and
levacccp [35]

Answer:

B. R is NP Hard

Explanation:

Given:

S is an NP complete problem

Q is not known to be in NP

R is not known to be in NP

Q is polynomial times reducible to S

S is polynomial times reducible to R  

Solution:

NP complete problem has to be in both NP and NP-hard. A problem is NP hard if all problems in NP are polynomial time reducible to it.

Option B is correct because as given in the question S is an NP complete problem and S is polynomial times reducible to R.

Option A is not correct because R is not known to be in NP

Option C is not correct because Q is also not known to be in NP

Option D is not correct because Q because no NP-complete problem is polynomial time reducible to Q.

5 0
3 years ago
Other questions:
  • Assume that you want to create an array containing ten Die objects. Which of the following code segment accomplishes this correc
    11·1 answer
  • If you want to copy a file from one folder to another , what would you do?
    15·1 answer
  • If a file's permissions are set to 760, what permission(s) are available to the group assigned to the file?â
    11·1 answer
  • Hey I don’t have a question I’m just testing something on this app
    6·2 answers
  • Assume a PHP document named hello.php has been saved in a folder named carla inside the htdocs folder on your computer. Which is
    11·1 answer
  • You are part of an Information Systems project team. Your job is to ensure that the technology and vendor suggested for use in t
    12·1 answer
  • Lester has to create an app that can support offline data and rich media content such as audio and video. In which programming l
    15·1 answer
  • A __________ search engine focuses on a specific subject.<br><br>answer : Specialized
    8·1 answer
  • Why does a computer need programs? ​
    8·2 answers
  • A user wants to print a spreadsheet horizontally on a piece of paper instead of vertically to fit more columns on a single page.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!