Question

In: Computer Science

Write a program that implements the pseudocode ("informal high-level description of the operating principle of a...

Write a program that implements the pseudocode ("informal high-level description of the operating principle of a computer program or other algorithm") below:
1. Ask the user for the size of their apartment in square meters (size)
2. Convert the size to square feet using the formula: convertedSize = size * 10.764
3. Print out the converted size.

Have meaningful prompts and meaningful explanation of any numbers printed.

Solutions

Expert Solution

Program:

import java.util.Scanner;

public class MeterToFeetConversion {

   public static void main(String[] args) {

       System.out.print("Please enter the size of apartment in square meters : ");
      
       // Create Scanner object to get user input
       Scanner in = new Scanner(System.in);
      
       // get user input for size of apartment in square meters
       float inputMeters = in.nextFloat();
      
       // convert size of apartment from square meter to square feet
       float meterToFeet = (float) (inputMeters * 10.764);
      
       // print the size of apartment in square feet
       System.out.println("The size of apartment in square feet : " + meterToFeet);

   }

}

Sample Output:

Please enter the size of apartment in square meters : 2
The size of apartment in square feet : 21.528


Related Solutions

Write a program that implements the pseudocode below: 1. Ask the user for the number of...
Write a program that implements the pseudocode below: 1. Ask the user for the number of days until finals. 2. Print out the weeks until finals (weeks = days // 7) 3. Print out the leftover days (leftover = days % 7) Note: Always have some labeling (identifying) text to explain the meaning of any numbers printed. And, do not forget to have your name and what the program does as comments in the beginning of your file.
write pseudocode for the following problems not c code Pseudocode only Write a C program to...
write pseudocode for the following problems not c code Pseudocode only Write a C program to print all natural numbers from 1 to n. - using while loop Write a C program to print all natural numbers in reverse (from n to 1). - using while loop Write a C program to print all alphabets from a to z. - using while loop Write a C program to print all even numbers between 1 to 100. - using while loop...
Given the below pseudocode, write the proper code that implements it using MARIE's assembly language:               ...
Given the below pseudocode, write the proper code that implements it using MARIE's assembly language:                    Input a number and store it in X; if X > 1 then    Y := X + X;    X := 0; endif; Y := Y + 1; Output the value of Y; N.B: You should include the MARIE code in your Answer, with an explanation of each instruction in your code beside it. Example:              Subt One         /Subtract 1 from AC Add a...
C Program and pseudocode for this problem. Write a C program that plays the game of...
C Program and pseudocode for this problem. Write a C program that plays the game of "Guess the number" as the following: Your program choose the number to be guessed by selecting an integer at random in the rang of 1 to 1000. The program then asks the use to guess the number. If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program keeps telling the player "Too High" or...
Write the Pseudocode for the following programming problem. Write a program that will calculate a tip...
Write the Pseudocode for the following programming problem. Write a program that will calculate a tip based on the meal price and a 6% tax on a meal price. The user will enter the meal price and the program will calculate tip, tax, and the total. The total is the meal price plus the tip plus the tax. Your program will then display the values of tip, tax, and total. The tip amounts based on the mean price are as...
write pseudocode not c program If- else programming exercises 1.    Write a C program to find...
write pseudocode not c program If- else programming exercises 1.    Write a C program to find maximum between two numbers. 2.    Write a C program to find maximum between three numbers. 3.    Write a C program to check whether a number is negative, positive or zero. 4.    Write a C program to check whether a number is divisible by 5 and 11 or not. 5.    Write a C program to check whether a number is even or odd. 6.    Write...
Program Specifications: Write a program that defines a class HumanBMI, implements it as required, and tests...
Program Specifications: Write a program that defines a class HumanBMI, implements it as required, and tests the class implementation. The class definition and implementation should be separated into HumanBMI.h and HumanBMI.cpp files. A. The class HumanBMI consists of three private member variables: name of type string, height of type int in inches, and weight of type int in pounds. The class HumanBMI also includes the following public member functions: 1) setName to set the name member variable with a string...
Write a python program that implements a Brute Force attack on Shift Cipher. In this program...
Write a python program that implements a Brute Force attack on Shift Cipher. In this program there is only one input - ciphertext - is a sequence of UPPER CASE letters. To make it easy, the program will be interactive and will output all possible plaintexts and ask user which plaintext makes sense. As soon as user will decide YES, the program will stop searching and print the desired plaintext and the found SHIFT KEY.
DESIGN A FLOWCHART IN FLOWGORITHM AND WRITE THE PSEUDOCODE Number Analysis Program Design a program that...
DESIGN A FLOWCHART IN FLOWGORITHM AND WRITE THE PSEUDOCODE Number Analysis Program Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: The lowest number in the array. The highest number in the array. The total of the numbers in the array. The average of the numbers in the array. PLEASE AND THANK YOU
please write a C program that implements Quick Sort algorithm.
please write a C program that implements Quick Sort algorithm.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT