plz convert to pascal ruby or c sharp
Q: Write a python program to read the area of a circle as input and print the message according to the…
A: area = int(input()) if area>=25 and area<=50: print("Small circle") elif area>50 and…
Q: 5. An integer is said to be prime if it's divisible by onlv 1 and itself. For example, 2, 3, 5 and 7…
A: int isPrime(int n){ for(int i=2;i <= n/2;i++) { if(n%i==0) {…
Q: By using C language and Pointer Notations and Arrays
A: //Program to traverse and display array with pointer notations //stadard input output…
Q: Given int variables k and totalthat have already been declared, use a for loop to compute the sum of…
A: Java program to solve the given problem is below.
Q: Task 8 Create a function isPressed which returns true if any of the capacitive touch pads have a…
A: It is a program in Arduino environment. We can use CircuitPlayground library to easily use the full…
Q: Write a program to perform the following function: • Ask users to enter weight and height • Display…
A: Your C program is given below as you required with an output.
Q: 1. Implement a uniform cost solution to find the path from C to B for the following graph A 1 B E C…
A: ALGORITHM:- 1. Initialize the given network with the edge weights as present. 2. Pass the network…
Q: convert uml to java code
A: In UML, an arrow represent inheritance. In the UML above Book is a derived class from class…
Q: 3/ TOD0: Dectare the has Consonant) function here ATTENTION SOLDIER int mein(voi) { char code ():…
A: Program Explanation: Declare the header files Define a function to find if a consonant is present…
Q: ode for python converting text file into dic and lm file dic - dictionary lm - language…
A: ALGORITHM:- 1. Create a file and insert key and values for the dictionary to be created in it. 2.…
Q: main.c Custom Input Output Tests Executions 1. 2nd Smallest 1 by Jemar Jude Maranga CE Run Tests…
A: Ans: Code: #include <stdio.h>#include <string.h> int main(){ int smallest,…
Q: What is array with c program
A: One dimensional array with C Programming Array is the sequential arrangement of data in memory with…
Q: May this be written in C language please
A: The libraries and keywords to print are different and remaining all remains same
Q: Given the following piece of code int i - 10; char c= 'A'; double f = 25.5; int *iptr = &i; char…
A: %d format specifier for printing integers %c format specifier for printing characters %x address For…
Q: J. Compute the area of circle, when its diameter is given. A = T x r2
A: The code for the two parts is shown below:
Q: Note: Request your Teacher to demonstrate python program execution from a file, taking input from…
A: Note: The formula for computing the compound interest is as follow: I=P(1+rn)nt -P Program…
Q: hen: 1) Add a public class constant which set the maximum area to 40.0 2) Add another constructor…
A: Algorithm: Start Create a class Room with attributes WindowNum,length,width Initialize a constant…
Q: Java byte codes are platform independent True False
A: Answer True Java byte codes are platform independent because they are compiled into a class file by…
Q: convert in C language
A: C and C ++: cout is used in c++.In c instead of cout printf is used. cin is used in c++ to get user…
Q: TASK (TO BE SUBMITTED) From 1 to 9, ang multiples of 3 are: 3, 6, 9. Ang sum ng 3 + 6 +9 is 18. So,…
A: The above question is solved in step 2 :-
Q: QUESTIOΝ- Write a program, which creates square matrices using two-dimensional array like those in…
A: #include <stdio.h> int main(){ int i,j,k,n,r[20][20],c; printf("\n Enter the matrix…
Q: g. Print the address stored in fPtr. Use the %p conversion specifier. h. Is the value printed the…
A: The pointer is a variable which stores the address of another variable. By the help of (*) operator…
Q: In this project you will implement a program that simulates a simple text editor with the undo/redo…
A: Programs: Programs contain the general instructions to perform certain tasks. The instructions are…
Q: package main2; import java.util.Scanner; Elpublic class main2 { 8 public static void main(String[]…
A: We need to convert the given code to python or Ruby or c sharp. We are converting this to python.
Q: The string type of the token is inconvenient to be used by models, which take numerical inputs. Now…
A: class Vocab: #@save """Vocabulary for text.""" def __init__(self, tokens=None, min_freq=0,…
Q: Write a program that initializes an array of size 10 with 10 integer values between 1 and 100. The…
A: Arrays: An array is a data structure that consists of a set of elements stored in a contiguous…
Q: Write a program named polygons.py that has two functions for generating convex regular polygons…
A: Algorithm of the code: 1. Define a function 'polygon()' that takes two parameters: size and n. 2.…
Q: help Asked question Convert decimal no to binary in C language.
A: Given, We have to write a program in C language to convert a Decimal no. into a Binary no.
Q: Display the current date and time using a programming language.
A: So we are given the task to print the current date and time using a language ( Pyhton )
Q: main.c 5. Only the Even Ones 1 #include by CodeChum Admin 3- int main(void) { I have an array of 100…
A: First of all, I ahve created an array with 100 elements into it. Here I have created a loop to…
Q: String Searching Challenge Write a program that takes two arguments at the command line, both…
A: Find the code below without the * implementation. The code may be edited to accomodate the same by…
Q: J. Compute the area of circle, when its diameter is given. A = T x r2 K. Compute the volume of a…
A: Start Input diameter Calculate radius Print Area Stop
Q: 10) Write a program that translates a letter grade into a number grade. Letter grades are A, B, C,…
A: Answer: I have answer of this question in python code. in below so that this code meet your…
Q: 1-[1, e, 2, e, 'hello', , []] list(filter(bool, 1))
A: EXPLANATION: True or False are the two values that Booleans represent. In Python, you may evaluate…
Q: 7. IMPLEMENTATION OF PAGE REPLACEMENT ALGORITHMS c) OPTIMAL PAGE REPLACEMENT ALGORITHM
A: When a new page is referred to in an operating system and it is not present in memory, a page fault…
Q: Exercise - Seconds since midnight 1 Let's write a program that reads the time from the user as three…
A: 12 o' clock here is assumed to be the midnight 12 o' clock (12:00 am). 1 minute contains 60 seconds.…
plz convert to pascal ruby or c sharp
Step by step
Solved in 4 steps with 3 images
- import java.util.Scanner;public class LabProgram { public static void main(String args[]) { Scanner scnr = new Scanner(System.in); int credits; int seed; GVDie die1, die2; die1 = new GVDie(); die2 = new GVDie(); // Read random seed to support testing (do not alter) seed = scnr.nextInt(); die1.setSeed(seed); // Read starting credits credits = scnr.nextInt(); int rounds = 0; while (credits > 0) { // Step 1: Roll both dice die1.roll(); die2.roll(); int total = die1.getValue() + die2.getValue(); if (total == 7 || total == 11) { // Player wins one credit credits++; // UPDATE - print the dice total here System.out.println("Dice total: " + total); //UPDATE - break the loop and end the round break; } else if (total == 2 ||…import java.util.Scanner; public class LabProgram { public static void main(String args[]) { Scanner scnr = new Scanner(System.in); int credits; int seed; GVDie die1, die2; die1 = new GVDie(); die2 = new GVDie(); // Read random seed to support testing (do not alter) seed = scnr.nextInt(); die1.setSeed(seed); // Read starting credits credits = scnr.nextInt(); int rounds = 0; while (credits > 0) { // Step 1: Roll both dice die1.roll(); die2.roll(); int total = die1.getValue() + die2.getValue(); if (total == 7 || total == 11) { // Player wins one credit credits++; } else if (total == 2 || total == 3 || total == 12) { // Player loses one credit credits--; } else { // Set the goal for future rolls int goal = total;…import java.util.Scanner; public class CharMatch { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String userString; char charToFind; int strIndex; userString = scnr.nextLine(); charToFind = scnr.next().charAt(0); strIndex = scnr.nextInt(); /* Your code goes here */ }}
- Java output caffeine levelsQuestion 2. package sortsearchassigncodeex1; import java.util.Scanner; import java.io.*; // // public class Sortsearchassigncodeex1 { // public static void fillArray(Scanner inputFile, int[] arrIn){ int indx = 0; //Complete code { arrIn[indx] = inputFile.nextInt(); indx++; } }Code example 2-1import java.util.Scanner;public class InvoiceApp {public static void main(String[] args) {Scanner sc = new Scanner(System.in);String choice = “y”;While (choice.equals(“y”)) {System.out.print("Enter subtotal: ");double subtotal = sc.nextDouble();double salesTax = subtotal * .0875;double invoiceTotal = subtotal + salesTax;String message = “Subtotal = ” + subtotal + “\n”+ “ Sales tax = ” + salesTax + “\n”+ “Invoice total = ” + invoiceTotal + “\n\n”System.out.println(message);System.out.print(“Continue? Enter y or n: ”);Choice = sc.next();}}} (Refer to code example 2-1.) If the user enters 100 the first time the while loop is executed, what will the program display at the console? a. Subtotal: 100.0 Sales tax: 8.75 Invoice total: 108.75 b. Subtotal = 100.0 Sales tax = 8.75 Invoice total = 108.75 c. Subtotal = 100.0 Sales tax = 8.75Invoice total = 108.75 d. Subtotal = 100.0 Sales tax = 8.75Invoice total = 108.75
- Code example 2-1import java.util.Scanner;public class InvoiceApp {public static void main(String[] args) {Scanner sc = new Scanner(System.in);String choice = “y”;While (choice.equals(“y”)) {System.out.print("Enter subtotal: ");double subtotal = sc.nextDouble();double salesTax = subtotal * .0875;double invoiceTotal = subtotal + salesTax;String message = “Subtotal = ” + subtotal + “\n”+ “ Sales tax = ” + salesTax + “\n”+ “Invoice total = ” + invoiceTotal + “\n\n”System.out.println(message);System.out.print(“Continue? Enter y or n: ”);Choice = sc.next();}}}38. (Refer to code example 2-1.) If the user enters “Y” when asked if he/she wants to continue, the application will a. repeat the while loop b. display a blank line, then repeat the while loop c. EndDebug java programimport java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String[] names = { "Ryley", "Edan", "Reagan", "Henry", "Caius", "Jane", "Guto", "Sonya", "Tyrese", "Johnny" }; int index; index = scnr.nextInt(); /* Type your code here. */ }}
- import java.util.Scanner; public class MealEstablishmentDirectory { public static void main (String[] args) { Scanner scnr = new Scanner(System.in); int newRating; String newState; MealEstablishment mealEstablishment1 = new MealEstablishment(); System.out.println("Default values: "); mealEstablishment1.print(); newRating = scnr.nextInt(); newState = scnr.next(); mealEstablishment1.setRating(newRating); mealEstablishment1.setState(newState); System.out.println("After mutator methods: "); mealEstablishment1.print(); } }import java.util.Scanner; public class Application {public static void main(String[] args){ int Num;float Ave;Employee[] Emp = new Employee[100]; System.out.println("Enter the number of employees:");Num = Integer.parseInt(new Scanner(System.in).nextLine());for (int i = 0; i < Num; i++){ Emp[i] = new Employee();Emp[i].Input();} System.out.printf("The list of employees:");System.out.println();Display(Emp, Num);Ave= AverageSalary(Emp, Num);System.out.printf("\nAverage salary is:" + "%.2f", Ave); System.out.printf("\nThe employee with highest salary is:\n" + employeeHigh(Emp, Num));}private static float AverageSalary(Employee [] emps, int n){float sum=0; for (int i = 0; i < n; i++)sum = sum + emps[i].salary;return sum/n;}private static void Display(Employee[] arr, int n){ for (int i = 0; i < n; i++){System.out.printf("%s",arr[i]);}}private static Employee employeeHigh(Employee[] arr, int n){ float high= arr[0].salary ;int iHigh = 0;for (int i = 1; i < n; i++){if( arr[i].salary…import java.util.Scanner; public class PetInformation {public static void main(String[] args) {Scanner scnr = new Scanner(System.in); Pet myPet = new Pet(); Cat myCat = new Cat(); String petName, catName, catBreed; int petAge, catAge; petName = scnr.nextLine(); petAge = scnr.nextInt(); scnr.nextLine(); catName = scnr.nextLine(); catAge = scnr.nextInt(); scnr.nextLine(); catBreed = scnr.nextLine(); // Create generic pet (using petName, petAge) and then call printInfo myPet.setName(petName); myPet.setAge(petAge); myPet.printInfo(); // Create cat pet (using catName, catAge, catBreed) and then call printInfo myCat.setName(catName); myCat.setAge(catAge); myCat.setBreed(catBreed); myCat.printInfo(); // Use getBreed(), to output the breed of the cat System.out.println(" Breed: " + myCat.getBreed());}}