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
fiasKO [112]
3 years ago
9

Create a pseudocode program that asks students to enter a word. Call a function to compute the different ways in which the lette

rs that make up the word can be arranged.
Computers and Technology
1 answer:
Arte-miy333 [17]3 years ago
6 0

Answer:

The pseudocode is given below

Explanation:

<u>Pseudocode</u>

  • Prompt user to enter string
  • Pass it to combination function which will calculate the total combination and will return it in array
  • In combination method -
  • Check if the string is length 2 size ie of 0 or 1 length then return string itself
  • Else iterate through string user entered
  • Get the current character in variable and check if the variable is already used than skip
  • Create a string from 0 to ith index + (concatencate) i+1 to length and recursive call combination function and pass this string and store result in subpermutation array
  • For each recursive call push character + subPermutation in totalArrangement array .
You might be interested in
Write a program that prompts the user to enter positive integers (as many as the user enters) from standard input and prints out
julia-pushkina [17]

Answer:

Here is the JAVA program that prompts the user to enter positive integers from standard input and prints out the maximum and minimum values:

import java.util.*;

public class Ex0603 {

   public static void main(String[] args) { //start of main function

   Scanner in = new Scanner(System.in); //creates Scanner class object to take input from user

   int minimum = 0; //stores the minimum of the integers

   int maximum = 0; //stores the minimum of the integers

   int num; //stores the positive integer values

   System.out.println("enter a positive integer: ");//prompts user to enter a positive integer

   num = in.nextInt();//scans and reads the input integer value from user

   minimum = num;  //assigns value of num to minimum

   while(true) {//while loop keeps prompting user to enter a positive integer

       System.out.println("enter a positive integer: ");//prompts user to enter a positive integer

       num = in.nextInt();//scans and reads the input integer value from user

       if(num <=0)//if the user inputs a negative integer or 0

           break; //breaks the loop

       if (num > maximum) {//if the value of positive integer is greater than the maximum of value

           maximum = num; } //assigns that maximum value of num to maximum variable

       if (num < minimum) {//if the value of positive integer is less than the minimum of value

           minimum = num; //assigns that minimum value of num to minimum       }    }            

   System.out.println("The maximum integer is : " + maximum); //displays the maximum of the positive integers

   System.out.println("The minimum integer is : " + minimum); }}   //displays the minimum of the positive integers

Explanation:

Here is the JAVA program that that prompts the user to enter an integer N, then reads N double values, and prints their mean (average value) and sample standard deviation:

import java.util.*;  

public class Ex0603 {  

public static void main(String[] args) { //start of main function

Scanner in = new Scanner(System.in);  //creates Scanner class object to take input from user

double integer= 0;  //to store the number of input values

double sum = 0;  //to store the sum of input numbers

double mean = 0;  //to store the average of numbers

double sd = 0;  //to store the standard deviation result

double variance = 0;  //to store the variance result

double sumSquare = 0;  //to store the sum of (num-mean)^2

int n = 0;  //to store the sample size N

   System.out.println("Enter an integer: ");  //prompts user to enter an integer that is how many elements user wants to input

   integer = in.nextInt();  //reads the value of integer from user

   double size=integer; // declares a double type variable and assigns value of int type variable integer to this double type variable size

   int i=0;  //used to point each element of the num array

   double num[] = new double[(int)size];  //declares an array to hold the numbers input by user

   while(integer>0){  //loop executes until value of integer is greater than 0

   System.out.println("Enter a number: "); // prompts to enter a number

   num[i] = in.nextDouble(); //reads double values

   sum += num[i];  //adds the values stored in num array

   i++;  //increments i to point to the next element in num array

   n++;  //increments n to count the total number of elements

  integer--; //decrements integer value at each iteration

   mean = sum / n;    }  //compute the average of values

   i=0;  

    while(size>0){  //loop executes until value of size exceeds 0

       sumSquare += Math.pow(num[i]-mean,2); //takes the sum of square difference between each element of num array and value of mean

       i++; //increments i

      size--;   }  //decrements size

variance = sumSquare / (n-1);  //compute variance by dividing the result of sum of the squares of their differences from the mean by n-1

   sd = Math.sqrt(variance);  //computes standard deviation by using sqrt function which takes the sqrt of the result of variance computed above

System.out.println("Average value is: " + mean+ " and the standard deviation is " + String. format("%.2f", sd));   }} //displays the average of numbers stored in mean variable and value of standard deviation is displayed up to 2 decimal places

Screenshots of both programs and their outputs is attached.

7 0
3 years ago
Thanks to ____ files, a website can recognize you and cater to your individual tastes each time you visit.
Licemer1 [7]
Saved files now and days
4 0
3 years ago
Gustavo is completing his homework online. When he uses a computer, what converts the information he inputs into instructions th
Otrada [13]
I can not understand your question, about it. What is homework of Gustavo working in, Visual or Dev C++ with any language?
4 0
3 years ago
Read 2 more answers
What is one way hackers can trick you into transmitting personal data over on a public network without your knowledge
Bumek [7]
Hmmm when they say that we have a debt of $10,000 but you don't but you don't know that so they ask you for the personal data for your bank so their can get in and get the money for you so you don't have to and that how they trick you
4 0
2 years ago
Write an algorithm to find the maximum and minimum number from a given list of N numbers .Assume the list is not sorted
Y_Kistochka [10]
MaxNumber = 0
minNumber = INT_MAX

for n in list:
  if( n > maxNumber):
   maxNumber = n
  elif( n < minNumber ):
   minNumber = n
4 0
3 years ago
Other questions:
  • Create a class named Person that holds the following fields: two String objects for the person’s first and last name and a Local
    5·2 answers
  • considering that two variables counters and accumulators are important in loop design. What would be their purpose?
    9·1 answer
  • The physical address assigned each network adapter is called its ________.
    6·1 answer
  • What are the 4-bit patterns used to represent each of the characters in the string "1301"? Only represent the characters between
    14·1 answer
  • What time does walmart deposit paychecks?
    5·1 answer
  • Your organization recently deployed a Windows domain controller with Active Directory. All the domain OU users need to run the s
    11·1 answer
  • What is a type of machine-to-human communication?
    14·1 answer
  • Write is an I.P.O cycle? Describe with figure​
    5·1 answer
  • On what menu in Microsoft Word can you locate the Macro feature?
    10·1 answer
  • How does your ability to correctly count change affect the impression the customer has of you?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!