answer.
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
Ksivusya [100]
2 years ago
15

You have several pictures of different sizes that you would like to frame.A local picture framing store offers two types of fram

es—regular andfancy. The frames are available in white and can be ordered in any colorthe customer desires. Suppose that each frame is 1 inch wide. The costof coloring the frame is $0.10 per inch. The cost of a regular frame is$0.15 per inch and the cost of a fancy frame is $0.25 per inch. The costof putting a cardboard paper behind the picture is $0.02 per square inchand the cost of putting glass on top of the picture is $0.07 per square inch. The customer can also choose to put crowns on the corners,which costs $0.35 per crown. Write a program that prompts the userto input the following information and then output the cost of framing the picture:a. The length and width, in inches, of the picture.b. The type of the frame.c. Customer's choice of color to color the frame.d. If the user wants to add the crowns, then the number of crowns.
Computers and Technology
1 answer:
exis [7]2 years ago
5 0

Answer:

written in java

Note :  Package name was excluded

 

import java.util.Scanner;

public class Main {

   public static void main(String[] args) {

       //declared 8 uninitialised variable  

       String input;

       double cost, colorC, frameC, paperC, glassC, crownC;

       char crowns;

       int type, color, crown, length, width, area, perimeter;

       

       //creating an instance of the Scanner class to accept value from user

       Scanner scanner = new Scanner(System.in);

       System.out.print("Enter length of frame: ");

       length = scanner.nextInt();

       System.out.print("Enter width of frame: ");

       width = scanner.nextInt();

       System.out.print("Do you want a fancy frame or a regular frame\nEnter 1 for fancy, 2 for regular: ");

       type = scanner.nextInt();

       if (type == 1) {

           frameC = 0.25;

       } else {

           frameC = 0.15;

       }

       System.out.print("Do you want a white frame or a colored frame\nEnter 1 for white, 2 for colored: ");

       color = scanner.nextInt();

       if (color == 2) {

           colorC = .10;

       } else{

           colorC = 0;

       }

       System.out.print("Do you want crowns \nEnter y for yes, n for no ");

       input = scanner.next();

       crowns = input.charAt(0);

       if (crowns == 'y' || crowns == 'Y') {

           System.out.print("How many crowns?");

           crown = scanner.nextInt();

       } else

           crown = 0;

       if (crown > 0)

           crownC = crown * .35;

       else

           crownC = 0;

       area = length * width;

       perimeter = length * 2 + width * 2;

       paperC = area * .02;

       glassC = area * .07;

       cost = glassC + paperC + crownC + colorC * perimeter + frameC * perimeter;

       System.out.println("The cost of your frame is: $" + cost);

   }

}

You might be interested in
Compare the encryption algorithms found in s-tools: idea, mdc, des, and 3des.
grin007 [14]
Are their answer chocies 

3 0
2 years ago
What is the argument in this function =AVERAGE(F3:F26)
monitta
The argument for the function would be answer "D".
5 0
2 years ago
dam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correct
Virty [35]

Answer:

Adam had most likely made a logic error.

Explanation:

Adam should check his code for any wrong formulas used or wrong arithmetic symbols.

6 0
2 years ago
Which of the following statements are true. .ascii stores string in memory and terminate it with NULL character. There is no way
Tems11 [23]

Answer:

The true statements are:

There is an assembler directive to arrange / place floating point values in static data memory

MARS always uses setting '.set boat'

Explanation:

It is the assembler directive who arranges and places the floating point values for the static data memory. Obviously there is no such way for the MIPS assemble programming for reservation of the static data memory without having any initialization for a considerable value.

MARS would definitely use the setting set “noat” ascii would store the string in the memory and then terminate it with respect to NULL character. They cannot reserve the MIPS assembly programming for a considerable value.

4 0
2 years ago
Write a program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your program on the following string
Artist 52 [7]

Answer:

#include <bits/stdc++.h>

using namespace std;

bool isPalindrome(string str)

{

   char a,b;

int length = str.length();

for (int i = 0; i < length / 2; i++)

{

   a=tolower(str[i]);//Converting both first characters to lowercase..

   b=tolower(str[length-1-i]);

   if (b != a )

return false;

}

return true;

   

}

int main() {

   string t1;

   cin>>t1;

   if(isPalindrome(t1))

   cout<<"The string is Palindrome"<<endl;

   else

   cout<<"The string is not Palindrome"<<endl;

return 0;

}

Output:-

Enter the string

madam

The string is Palindrome

Enter the string

abba

The string is Palindrome

Enter the string

22

The string is Palindrome

Enter the string

67876

The string is Palindrome

Enter the string

444244

The string is not Palindrome

Explanation:

To ignore the cases of uppercase and lower case i have converted every character to lowercase then checking each character.You can convert to uppercase also that will also work.

6 0
2 years ago
Other questions:
  • Static packet filtering firewalls are limited to ________. inspecting packets for which there are good application proxy filteri
    8·1 answer
  • Which broad area of data mining applications analyzes data, forming rules to distinguish between defined classes?
    13·1 answer
  • Refer to the exhibit. The PC is connected to the console port of the switch. All the other connections are made through FastEthe
    6·1 answer
  • Create a program that includes a function called toUpperCamelCase that takes a string (consisting of lowercase words and spaces)
    9·1 answer
  • 5.14 ◆ Write a version of the inner product procedure described in Problem 5.13 that uses 6 × 1 loop unrolling. For x86-64, our
    8·1 answer
  • Which statement is true about the purpose of a work in process constraint?
    15·1 answer
  • Write a function named shout. The function should accept a string argument and display it in uppercase with an exclamation mark
    6·1 answer
  • A video game character can face toward one of four directions: north, south, east, and west. Each direction is stored in memory
    15·1 answer
  • there is a structure called employee that holds information like employee code, name, date of joining. Write a program to create
    13·1 answer
  • In this problem, you will derive the efficiency of a CSMA/CD-like multiple access protocol. In this protocol, time is slotted an
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!