Create a program

117 views 10:56 am 0 Comments July 4, 2023

Resit SOBs

The SOBs should be done and demonstrate to the tutor on the 14th of July.

Create a program that asks the user for their favourite colour and animal, then prints out a sentence using the provided information.

Create a program that reads the base and height of a triangle from the user in centimetres and calculates the area of the triangle.

Create a program that reads a temperature in Celsius from the user and displays the equivalent temperature in Fahrenheit and Kelvin.

Calculate the volume of a sphere using the Math class and ask the user to enter the value of the radius. Print out the calculated volume.

Write a program that counts the number of vowels (a, e, i, o, u) in a given word entered by the user.

Write a program that checks if a given word entered by the user is a palindrome (reads the same forwards and backwards). If it is not a palindrome, allow the user to enter the word again.

Write a method that counts the number of occurrences of a specific letter in a string. Prompt the user to enter a string and a letter, then display the count.

Write a function that returns the index of the smallest element in an array of integers. Prompt the user to enter ten numbers, invoke this method to return the index of the smallest element, and display the index.

Write a function that returns the product of all the elements in a specified column in a matrix. Read a 4×4 matrix from the user and display the product of each column.

Design a class named Person. The class should have data fields for the person’s name, age, and gender. It should also have methods to set and get the values of these fields. Write a test program that creates two Person objects with different data and tests the functionality of the class.

Write a program that converts between different temperature units, such as Celsius, Fahrenheit, and Kelvin. Allow the user to enter a value and select the conversion units.

Write a program that simulates a simple chat between a server and a client. The client sends a message to the server, and the server responds with a predefined response. Allow multiple rounds of communication between the server and client.

Create a program that asks the user for their favourite colour and animal, then prints out a sentence using the provided information.

Create a program that reads the base and height of a triangle from the user in centimetres and calculates the area of the triangle.

Create a program that reads a temperature in Celsius from the user and displays the equivalent temperature in Fahrenheit and Kelvin.

Calculate the volume of a sphere using the Math class and ask the user to enter the value of the radius. Print out the calculated volume.

Write a program that counts the number of vowels (a, e, i, o, u) in a given word entered by the user.

Write a program that checks if a given word entered by the user is a palindrome (reads the same forwards and backwards). If it is not a palindrome, allow the user to enter the word again.

Write a method that counts the number of occurrences of a specific letter in a string. Prompt the user to enter a string and a letter, then display the count.

Write a function that returns the index of the smallest element in an array of integers. Prompt the user to enter ten numbers, invoke this method to return the index of the smallest element, and display the index.

Write a function that returns the product of all the elements in a specified column in a matrix. Read a 4×4 matrix from the user and display the product of each column.

Design a class named Person. The class should have data fields for the person’s name, age, and gender. It should also have methods to set and get the values of these fields. Write a test program that creates two Person objects with different data and tests the functionality of the class.

Write a program that converts between different temperature units, such as Celsius, Fahrenheit, and Kelvin. Allow the user to enter a value and select the conversion units.

Write a program that simulates a simple chat between a server and a client. The client sends a message to the server, and the server responds with a predefined response. Allow multiple rounds of communication between the server and client.Human Computer Interaction

Tags: , , , , , , , , , ,